Request working in postman not in other app

When i make a request to my application from postman it works as expected. When I put the information into my other app (the one that i will use to actually make the requests) i get authorization failed. I feel like its a syntax on how the information is being sent. I was hoping to find a way to see exactly what postman is sending so I can copy the same format.

I am using filemaker 19 pro. which includes an option to insert from URL (designed for use with RESTful apps). I am setting the correct headers, but not sure is the authorization portion is a header of username:xyz and password:1234 or if it is a special type of header.

I know this is vague which probably wont garner a good response, but I am really trying hard to figure this out. any help would be much appreciated.

thanks,

Rob

Hey Rob,
There’s this code generation feature of Postman that I recently learned about. So let’s say in Postman you have added your authorization and other params, and you want to see what is being passed in the headers, etc. you can click on the Code button on the right side of the request.

This link describes it well - https://learning.postman.com/docs/sending-requests/generate-code-snippets/#generating-code-snippets-in-postman

For example, this is a snippet that was generated based on the request I had -

curl --location --request PUT 'api-101.glitch.me/customer/placeholder' \
--header 'user-id: 71c111ed-2fe0-43d3-a75d-da9de1a4454a' \
--header 'Authorization: Basic ZGVtbzpkZW1v'

I hope that helps.

Thanks,
Meena

2 Likes

Thank you Meena for replying to this post since it’s so vague!

I have been using the code window and it has helped. I have not been able to get the syntax correct and I think it’s linked to the \ at the end of each line in the curl settings. my code looks like this:

This is from Postman:

curl --location --request GET ‘https://xxxx.mydomain.com/v4_6_release/apis/3.0/company/companies?conditions=name=“some%20customer%20name”’ \

–header ‘clientID: ef43c238-ff31-93b1-4f8a-8169-ba2c0419811a’ \

–header ‘Authorization: Basic fdsjkl7334mklafhjkXdm9TQ0swN2w6Nmt4ZnMzNDVyaE9NYWxSaw==’

does the Curl info get sent in the browser header? I gave seen some REST APIs out there ask for an API Key and I have seen that in the browser request, but how does the curl info get passed?

I know these are general questions, but all help leading to a solution. thanks again for your reply and kindness in helping a newbie with this understanding.

Rob

I figured the syntax out after 4 days of searching, watching videos, trying demos from various companies, and generally tearing my hair out.

I want to say thank you to Meena for answering quite possibly the worst formed and vague request I have ever made. I was so confused that I failed to even ask a proper question. I really needed to have someone just push a little. Thank you very much!

Rob

1 Like

Hey @rob1,
No problem at all. It’s a bit more effort starting out, I’m glad I could help. All the best.
You can use Postman to play around with different APIs and explore more.

I like this template on Postman that would get you comfortable with REST apis and Postman - https://explore.postman.com/templates/11317/api-101

All the best!

Meena