Metadata and state

You can store instance state and metadata in Zendesk Support by making POST requests to Zendesk Support with the data. Zendesk Support provides this as a convenience. Zendesk Support doesn't interpret or use any of the data. Zendesk Support passes the metadata and state values back to your integration service when making POST requests to your integration service.

You can store the information in your own system if you prefer. However, this requires you to implement your own security and access controls. It could also introduce security vulnerabilities in your integration service, especially when the integration service is serving multiple Zendesk Support accounts.

Storing metadata and state in Zendesk Support doesn't prevent you from storing other information in your system.

Zendesk Support never uses or parses the data so you can use any data format you like, so long as it can be stringified to be passed in POST requests. The data format can be stringified JSON, YML, XML, or even base64 encoded binary data. Example:

"metadata": "{\"instagram_username\":\"omniwear\",\"instagram_oauth_token\":\"xyzabc\"}","state":    "{\"last_message_id\":\"20151210083200-bob\"}",...

Metadata

Metadata is information about the integration instance as a whole. It’s set and modified by Zendesk Support administrators using your administrative interface. Examples include:

  • Authorization token for the origin service
  • Whitelist of users from the origin service
  • Maximum number of comments to import per message

Metadata information is passed and stored as stringified data. Example:

"metadata": "{\"instagram_username\":\"endgames_improv\",\"instagram_oauth_token\":\"xyzabc\",\"max_comments_per_message\":\"120",\"whitelisted_users\":\"robert,simon\"}"

When parsed in your system:

{  "instagram_username": "omniwear",  "instagram_oauth_token": "xyzabc",  "max_comments_per_message": "120",  "whitelisted_users": "robert,simon"}

State

State is information about the current state of pull for the integration. See Pull requests. It can change every time Zendesk Support pulls content from the integration service. Your integration service can use it as a bookmark to know what work has been done and what work remains. Examples include:

  • Timestamp of last message processed, to determine what external resources Zendesk Support hasn't seen yet
  • Origin service remaining API quota, to make sure the integration service doesn't exceed the API limit for this instance on the origin service

Like metadata, state information is passed and stored as stringified data. Example:

"state": "{\"last_message_id\":\"20151210082800-erika\"}",

When parsed in your system:

"state": {"last_message_id": "20151210082800-erika"}