Hi Team,
I want to use the Webhook functionality for the invoice or purchase order creation. I have registered the webhook on the Invoice PDF created and Purchase order pdf created event and it is working as expected by hitting the provided URL. Acc. to the documentation ( https://affinitylive.jira.com/wiki/spaces/APIS/pages/83951623/Webhooks ), the response should consist of a resource_url which should be like:
"resource_url": "https://bobs-burgers.api.accelo.com/api/v0/issues/1.json"
But it is giving the following response:
"resource_url":"https://dev.api.accelo.com/api/v0/resources/311.json",
The resource_url should contain the attached event like invoices or purchases, but it is generating a common URL that contains resources and sending the HTTP request to this endpoint does not return any information (like id) of the created invoice/purchase order.
Is there any configuration that I have missed? Or it is not possible to get the correct resource.
Thanks
NO, this is not an optimal solution. Multiple invoices/purchase orders may get created at the same time. So, it may result in the processing of the wrong data. Also, I have tried the following GET request:
https://dev.api.accelo.com/api/v0/resources/?_filters=order_by_desc(316) # In the id, I have passed 316which is the resource id returned by the webhook response.
But the response of the above request is not returning the created/updated resource Id instead it is returning the array of some random invoices.
"response": [
{
"id": "174",
"title": "invoice_23.pdf"
},
{
"title": "invoice_23-1.pdf",
"id": "175"
},
{
"title": "invoice_37.pdf",
"id": "176"
}
]
Is it not possible to achieve the created purchase order/invoice id through webhook response? The expectation from Webhook's response is to provide information like the id of the created invoice/purchase order.