Skip to main content
Level 6
Nov 2, 2023 6:43 PM UTC
Solved

403 Forbidden error when running API custom action in AJO

Hi there,

 

We are trying to send a signal over to a 3rd party app to delivery SMS. There are two primary steps: 1) Fetching an OAuth Token, setting the client id and secret, and then putting the token into the Header as part of the API call, this call works in Postman.

 

But when I replicate the same settings into AJO, i get a 403 Forbidden error. Is there anything special I need to configure on the AJO in addition? Things I can confirm:

1) The endpoint is the same between Postman and AJO

2) Authentication returns "Test successful", and I also have this  "tokenInResponse": "json://access_token" in the payload

3) The Payload request is directly copied from Postman.

 

Any advices would be appreciated. Thank you!!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
akwanklAccepted solution
Level 6
Nov 13, 2023 11:40 PM UTC

Thanks all. Issue happened to be with my company's own gateway config. It is resolved now!

4 replies

SatheeskannaK
Adobe Champion, Community Advisor, UG Leader
Adobe Champion, Community Advisor, UG Leader
Nov 2, 2023 7:17 PM UTC

@akwankl It should work when it's working on the postman. Can you check for any additional headers you need to include as part of the custom action by comparing the headers that you have on the postman for the same API endpoint? 

Translate
Thanks, Sathees
akwanklAuthor
Level 6
Nov 2, 2023 8:22 PM UTC
The headers are the same, it's actually pretty simple.
 
POSTMAN (working):
curl --location 'https://' \
--header 'Content-Type: application/json' \
--header 'Charset: UTF-8' \
--data-raw '{
    <body>
}'
 
 AJO:

 

Translate
Manoj_Kumar
Community Advisor
Community Advisor
Nov 13, 2023 11:29 PM UTC

Try adding Accept to the request headers.

Accept: application/json 

 

Translate
Manoj  | https://themartech.pro
akwanklAuthorAccepted solution
Level 6
Nov 13, 2023 11:40 PM UTC

Thanks all. Issue happened to be with my company's own gateway config. It is resolved now!

Translate