table name missing error in attachment rest API

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2020 08:51 AM
I am working on a incident Servicenow-Servicenow ebonding. When i am trying to send the attachment from one instance to other i am getting error in the resonse code-"{"error":{"detail":null,"message":"Missing parameter: table_name"},"status":"failure"}"
I have written a BR on sys_attachment table-
Please find the REST message below-

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2020 09:20 AM
In the header, are you specifying the "Content-Type" to be a binary file?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2020 09:35 AM
update as below
request.setQueryParameter("table_name", "incident");
request.setQueryParameter("table_sys_id", <SYS ID HERE>);
request.setQueryParameter("file_name", name);
request.setRequestHeader("Content-Type", tokenID);
request.setRequestHeader("Accept", "application/json");
request.setRequestBodyFromAttachment(attach);
Muhammad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2022 08:35 AM