200 GET API but Not Body Response

My question:
After run my 2 API (Post and Get) to get the Access token, I am able to get 200 in both. The Post shows Body response with the token, but the Get doesn’t show Body response from the url I am accessing.

Details (like screenshots):

How I found the problem:
Checking the body response in the GET Api with 200 Ok. Boy is empty.

I’ve already tried:
I verified any kind of response, JSON (I was expecting), Html, Text
I turned OFF the SSL certification in Postman settings
I hardcore the authentication token

You need to read the specification for the API as this will dictate what needs to be sent.

However, that request looks a bit odd.

If you have retrieved the code, and then exchange it for a token (which appears to be working).

Then I suspect the authentication for the GET request (actualRequest) should be set to Bearer token with the id_token from your exchangeCode being saved to a variable. It does tell you that the token type is “bearer”.

However, you will need to refer to the API spec to confirm.

On a side note, this looks like a training course. Can’t you discuss it with the trainer?

Thank you. Yes, it is set to Bearer. And you are right, we got the code and the exchange it for the token. I even copied the same request for the teacher. I already asked in the course “Udemy” hopefully I get an answer. I appreciate your input

In the URL for the actual request, it looks like you are repeating the code elements which usually aren’t needed. It doesn’t look like the authorisation options are correct which is what generates the extra info in the URL. You just need the bearer token which gets added to the header.

The authorization type just needs to be set to “Bearer Token” which should only give you one option underneath which will be the token which you set to the variable (as in my previous screenshot). You shouldn’t see grant type and callback URL. Those were needed for the previous requests but now you have the bearer token, then shouldn’t be needed for the GET request.

On another note, what are you sending as the parameters for the actual GET request.

Like the course details you want to return.

Where does the instructions for the course tell you the parameters for the request meant to go. Do they need to be params, or setup as a JSON body? (I’m not sure you have any, which might be why its returning blank data).

1 Like

These are the only parameters the course indicates. It is a video so he shows the exact parameters to compare. but I imported his project to my Postman yesterday and I got the same issue.

I just got it!!! Under OAuth 2.0, “Add Authorization data to” , I didn’t have selected to the URL. I changed it and now I can see the response :slight_smile:
Thank you so much for jump to help me :slight_smile:

1 Like