You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Creating file attachment with REST API fails when following sample code

Received Response
16
Views
2
Comments
edited Jun 8, 2022 12:02PM in General Technical Discussions 2 comments

Content

When attempting to create an attachment with the new REST API, it fails:

I follow the doc (http://documentation.custhelp.com/euf/assets/devdocs/november2015/Connect_REST_API/wwhelp/wwhimpl/js/html/wwhelp.htm#href=Connect_REST_API.1.18.html), doing a POST to https://xxxyyyzzz.custhelp.com/services/rest/connect/v1.3/incidents/20/fileAttachments with body from the doc example:
{
"fileName":"SampleFileAttachment.txt ",
"data":"c2FtcGxlIGNvbnRlbnQgZm9yIGZpbGUgYXR0YWNobWVudA=="
}

The response is a 400 Error:
{
    "type": "https://xxxyyyzzz.custhelp.com/services/rest/connect/exceptions/OSC-CREST-00012",
    "title": "Problem creating resource",
    "status": 400,
    "detail": "Error attempting to create resource: File specified could not be found: /tmp/c2FtcGxlIGNvbnRlbnQgZm9yIGZpbGUgYXR0YWNobWVudA==",

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!