OOTB API failing when executed from another instance or Postman but works fine on the main instance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2023 09:42 PM
I am working on the OOTB add item to cart api (present in sn_sc namespace). When I run it on the instance where I have the catalog item, it runs fine(status code 200). However, when I run the same json with the same request url on postman or try to invoke the api from another NOW instance, it fails with status code 500. I am using the same credentials (username and password) in POSTMAN (Basic auth) as that present on my main instance. Any pointers? Below is the error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2023 10:10 PM
Hi @Saquib Mohammed ,
Here are a few things you could check to try and resolve this issue:
Check if the endpoint you are trying to access is reachable from the other instance or Postman. You could try pinging the endpoint or accessing it through a web browser to see if it responds.
Check if the credentials you are using to authenticate the request are valid and authorized to access the endpoint. You could try logging in to the instance using the same credentials to ensure that they are valid.
Check if there are any firewall rules or network restrictions that are preventing the request from being made. You could try accessing the endpoint from a different network or using a proxy to see if the request goes through.
Check if the JSON payload being sent in the request is valid and in the correct format expected by the API. You could try validating the JSON using an online validator or comparing it to the JSON payload generated by the instance where the API is working.
Check the instance logs to see if there are any errors or exceptions being thrown that could be causing the API to fail. This could give you more insight into the root cause of the issue.
Check if the OOTB API is exposed and enabled for external access. Some OOTB APIs are not intended for external use and may require additional configuration to be accessible from other instances or Postman.
If my response was helpful in resolving the issue, please consider accepting it as a solution by clicking on the ✅Accept solution button and giving it a thumbs up 👍. This will benefit others who may have a similar question in the future.
Thank you!
Ratnakar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2023 08:41 AM
1. Can you let me know how to do that? When I render the endpoint on browser, it throw error saying "GET method not supported for API" - which is accurate but how do I test the reachability for this POST API?
2. The credentials are correct. Like I said earlier, it is the same credentials with which I am executing in the original NOW instance
3. How do I check for firewall rules? I am able to execute my custom API using the same credentials through POSTMAN. It's just the OOTB api that is failing.
4. json payload is correct. Like I said earlier, it is the same payload which I am using in the original NOW instance
5. I dont see any logs
6. How do I check if this OOTB api is exposed and enabled for external access?