API - Tickets & Worksheets

Hi all,

I am trying to create an Ad Hoc Worksheet in a ticket using the API but the API is responding 404 to my requests.

I am making a post request to this URL https://ourinstance.syncromsp.com/api/v1/tickets/47343115/worksheet_results

The ticket does exist https://ourinstance.syncromsp.com/tickets/47343115

POST /api/v1/tickets/47343115/worksheet_results HTTP/1.1

Authorization: xxxxxx

Content-Length: 0

Content-Type: application/json

Host: ourinstance.syncromsp.com

HTTP/1.1 404 Not Found

access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, Authorization

access-control-allow-methods: GET

access-control-allow-origin: *

cache-control: no-cache, no-store

connection: close

content-type: application/json; charset=utf-8

date: Tue, 26 Oct 2021 12:40:39 GMT

referrer-policy: strict-origin-when-cross-origin

server: Cowboy

vary: Origin

via: 1.1 vegur

x-content-type-options: nosniff

x-download-options: noopen

x-frame-options: SAMEORIGIN

x-permitted-cross-domain-policies: none

x-request-id: 53363c8e-a210-4ffb-9660-de97008f33d8

x-runtime: 0.035165

x-xss-protection: 1; mode=block

{"message":"Not found"}

I get the same issue using the API Docs tool.

Can someone take a look please? I am probably doing something wrong so please point me in the right direction :blush:

(FYI a GET request to the same URL works fine, it sends me back the worksheets on the ticket).

Thanks in advance.

Hi @dylan

Are you using the ID from the URL of the worksheet template? The template ID is different from the individual worksheet ID. That worksheet ID can be obtained by using an API call to get the ticket details. It will be listed in “worksheet_result”.

Hi @dylan,

I see that you managed to resolve this by creating a support ticket and the solution was to have the worksheet template already created before calling the Worksheet’s APIs.

Is there a way to attach a worksheet to a ticket with fields created from the API?

I can only successfully add worksheets from a worksheet template.

ANy help appreciated.

Hey @jamie,
Based on the Syncro API documentation it doesn’t look like we’re able to create or attach a worksheet or worksheet template to a ticket via the API.

The work around for this is to use custom field types. If you’re in Syncro and navigate to Admin > Tickets > Ticket Custom Fields. You can create a custom field type there and actually assign worksheet templates for that custom ticket field type. Then you can just set that custom field type on a ticket via the API and it will automatically attach the associated worksheet templates.

@dylan this won’t help you with your ad-hoc worksheets but might help you if you can find a way to leverage worksheet templates instead.

Best of luck!