Cannot reorder triggers using API | Community
Skip to main content

Cannot reorder triggers using API

  • November 16, 2021
  • 5 replies
  • 0 views

Jose26

I am using the API.

I call `GET /api/v2/triggers` to get all triggers, and then with that result I get the IDs and call `PUT /api/v2/triggers/reorder`, but I get the following:
400 Bad Request
{"error":"UnknownAttributeError","description":"Invalid attribute: all triggers are not provided"}

What am I missing?

5 replies

Tipene
  • November 16, 2021
Hi Jose,
 
Thanks for reaching out!
 
Generally, you’d see this error being caused by the full list of trigger IDs from your Zendesk account not being included in the trigger_ids array sent with the reorder request.
 
Can you double-check that all trigger IDs are being included in the payload - it might be worth cross-referencing the trigger section in your Zendesk instance UI as well, if practicable.
 
Let me know if you continue to have any issues!
 
Tipene

Jose26
  • Author
  • November 17, 2021

Hi Tipene, thank you for your reply.

Is there any other way I can get the `trigger_ids` from the API?

I am doing the `PUT` with the following payload:

{"trigger_ids": [36003953XXXX,...,36011358XXXX]}

Those IDs are the same 161 I am getting from the `GET`, see the following response please:


Tipene
  • November 17, 2021
Just to confirm, are you paginating to the next page to access the additional 61 records, and adding them to your ticket_ids array? The GET request only returns a maximum of 100 records per page so if there are more than that, you’ll need to grab those other records as well.
 
https://developer.zendesk.com/documentation/developer-tools/pagination/paginating-through-lists-using-cursor-pagination/

Jose26
  • Author
  • November 17, 2021

I do, yes.
I have talked with a developer using Zendesk slack, pretty cool. He has done some tests and created an internal ticket to resolve it, it seems there is a bug.
Thank you Tipene for you help.

 


Tipene
  • November 17, 2021
No worries at all! Feel free to update this post with any relevant findings.
 
Have a great day!
 
Tipene