jsonrestticket-system

Connectwise Ticket API: Invalid ServiceNote Object


I've been trying to add a note to an existing ticket with the rest api

endpoint: cw.mycompany.com/v4_6_release/apis/3.0/service/tickets/1327224/notes

request body:

{
    "text":"Test message"
}

However, I get the following response:

{
    "code": "InvalidObject",
    "message": "serviceNote object is invalid",
    "errors": [
        {
            "code": "ServiceNote",
            "message": "Please choose where to display the notes in order to save this record.",
            "resource": "serviceNote",
            "field": "detailDescriptionFlag, internalAnalysisFlag, resolutionFlag"
        }
    ]

}

What do I need to add to my request to add the note to my ticket? I don't see anything in the ServiceNote Object that looks like a "display location" or something to that effect anywhere.

Thanks,

~Josh


Solution

  • Provide one of the "field" values listed in the error as a boolean; either detailDescriptionFlag, internalAnalysisFlag, or resolutionFlag.

    Most likely you'll be using detailDescriptionFlag. An example payload for this would be:

    {
          'text'                  : 'Hello World',
          'detailDescriptionFlag' : true
    }
    

    None of this is covered in their REST documentation for Create Service Note.