Day 6: Imported "The Good Bank" API return Status 403

While solving the challenge on day 6, I ran into problems after running step 4. Because when I run the Create User request from the Good Bank API, I get a 403.

It’s not clear to me if it’s a bug that the API is presenting now or something I’ve missed doing.
But it caught my attention that for a request, with the PUT method, nothing is being sent in the body of the request.

Please help.

The body for the request is incorrect and the 403 status code is correct.

Not sure why you’ve mentioned PUT, as this is a POST request.

I’ve included the instructions for step 4.
What values does it say needs to be updated?
Do they exist in your body?

Set up a new user: Find the following request in the The Good Bank APIs collection, and duplicate it over to the Setup folder.

  • POST Create User

Under the Body tab, update the username and password of your new user. Make a note of this information using any method you prefer. Hit Send to create a new user. The response will contain a user_id. Create a collection variable called user_id with this information, using any method you prefer.

This is what the default Create User work request looks like.

image

Hello, thanks for the prompt response.
Sorry, I incorrectly mentioned the method, (POST).

In my case, what is happening in step 4 is that the body is empty. (from the original API)

I can replicate the issue, but know why its happening.

I don’t know if its an new feature or not as I can’t remember changing any of the default import settings when I did this challenge.

When you import the YAML file, you can select “import settings” and one of the settings is related to the parameter generation. You need to change this to Example (from Schema).

This is the relevant part of the schema.

  /user:
    put:
      tags:
        - Bank User > Authentication
      summary: Update User Information
      description: Authenticated users can update their user information.
      security:
        - ApiKeyAuth: []   
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                email_id: kmmanoj96@gulbank.com
                phone: +91 9876543210
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
    post:
      tags:
        - Bank User
      summary: Create User
      description: Register a new user with The Good Bank. The username must be unique.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                username: kmmanoj96001
                password: kmmanoj96001pass
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}

If you select Schema, it would appear to create an blank object {}. If you select Example, then it creates it based on the Example.

If someone from Postman is reading this, then I would maybe suggest an slight amendment to the instructions for this challenge.

1 Like

This topic was automatically closed after 90 days. New replies are no longer allowed.