Skip to main content

Hello:

I have an external resource that has an API that utilizes basic authentication using a token.

When I run the api call using postman or other REST API testing software, I get an OK response.

When I try running it using the httpcaller, I get a:

HTTPCaller(HTTPFactory): Received HTTP response header: 'HTTP/1.1 403 Forbidden' message.

Inspecting the response body gives:

{"code":"rest_forbidden_context","message":"Sorry, you are not allowed to view entries","data":{"status":403}}

 

I know that the api is working because it works in POSTMAN and other REST API testing software. What am I missing to get http caller to work?

I'm new to APIs and to FME. I'll be happy to provide any info needed.

Thanks!

 

Herbert Cruz

 

Here's the input on FME.

 

And here's the RESTLET testing input

 

 

 

Thanks everyone!

Hi @yong_sa, can you share the details of the request that is working in POSTMAN?

 

- URL

- Headers

- HTTP Method (GET,POST, etc. )

- Body (if applicable)

Thanks


URL: https://pocoworks.portcoquitlam.ca/wp-json/frm/v2/entries

HTTP Method: GET

Headers:

Authorization : "API TOKEN FROM RESOURCE"

Body: None


I figured it out. Instead of putting the API token into the authorization header, I had to put in a username and password combination encoded in base 64 to successfully get information from the API.

 

Thanks!


I figured it out. Instead of putting the API token into the authorization header, I had to put in a username and password combination encoded in base 64 to successfully get information from the API.

 

Thanks!

Great! You could also use the Authentication option in the HTTPCaller and just enter the username and password. This will generate the header with the base 64 encoded string for you.


Reply