API Rest Message Attachment

Govind Bysani
Tera Contributor

I have a doubt in API Rest Message Attachment, I am not able to see the attachment not getting reflected in instance A  when I attach it in instance B, But I can able to see attachment getting reflected in instance B when I am attaching in instance A. below mentioning the endpoint which I have kept in instance B POST rest message;

 

https://<instance-name>.service-now.com/api/now/attachment/file

 

Note: Instance A is ServiceNow Instance
           Instance B is non-ServiceNow Instance.

 

1 REPLY 1

Ratnakar7
Mega Sage
Mega Sage

Hi @Govind Bysani ,

 

The issue you are facing could be due to various reasons, such as authentication or permissions.

Here are some possible reasons and steps to troubleshoot the issue:

  1. Authentication: Ensure that you have provided the correct authentication details in the REST message on Instance B. You might need to use basic authentication or OAuth tokens depending on the security settings of Instance A.

  2. Cross-Origin Resource Sharing (CORS): Check if Instance A has CORS enabled to allow requests from Instance B. If CORS is not enabled, the request from Instance B might be blocked by the browser.

  3. Request Format: Ensure that the request from Instance B is formatted correctly with the necessary headers and data to attach the file.

  4. Permissions: Check if the user making the API request from Instance B has the necessary permissions to attach files to records in Instance A.

  5. Error Handling: Check the response received from Instance A when making the API call from Instance B. It might contain helpful error messages indicating why the attachment is not getting reflected.

  6. Instance A Settings: Review the settings and configurations of Instance A related to attachments, including file size limits, file types, etc.

If you have verified all these aspects and still encounter issues, it might be helpful to check the ServiceNow instance logs and monitor the network requests to see if there are any specific errors or issues occurring during the attachment process.

Additionally, consider testing the API call using tools like Postman or cURL to isolate any potential issues with the REST message configuration or the request itself.

 

Thanks,

Ratnakar