Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tickets/search API unable to retrieve tickets with a custom ticket_attribute set #139

Open
tommyhutcheson opened this issue Mar 12, 2024 · 0 comments

Comments

@tommyhutcheson
Copy link

tommyhutcheson commented Mar 12, 2024

tickets/search API unable to retrieve tickets with a custom ticket_attribute set

Hello

I am looking to use the tickets/search API to retrieve tickets with a particular ticket_attribute set.

This might already be possible but I am getting the syntax wrong, I can see on this page https://developers.intercom.com/docs/references/rest-api/api.intercom.io/Tickets/searchTickets/
it says you can use ticket_attribute.{id} as a field key but when I try this with a ticket attribute I am getting an error - field_not_found The request ticket attribute ID is not a valid integer response 400

Please advise on what I could be doing wrong here, thank you

Expected

import requests

url = https://api.intercom.io/tickets/search
 
payload = {
  "query": {

    "operator": "AND",

    "value": [

      {

        "field": "ticket_attribute.{my_ticket_attribute}",

        "operator": "=",

        "value": "Ready"

      },

      ]

   }

}


headers = {
  "Content-Type": "application/json",

  "Intercom-Version": "2.10",

  "Authorization": "Bearer <YOUR_TOKEN_HERE>"

}


response = requests.post(url, json=payload, headers=headers)


data = response.json()

print(data)

Reproduction Steps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant