Target Failures

Targets are pointers to cloud-based applications and services, as well as to HTTP and email addresses. Targets are used with triggers and automations to send a notification to the target when a condition is met in Zendesk Support. See Notifying external targets. A target failure record is created when the target returns an error.

JSON Format

Target failures have the following properties:

Name Type Comment
id integer The ID of the target failure
url string The API url of the failure record
target_name string Name of the target failure
status_code string HTTP status code of the target failure
message string The message returned with the status code
created_at string Time of the failure
consecutive_failure_count integer Number of times the target failed
raw_request string The raw message of the target request
raw_response string The raw response of the failure
Example
{
  "id": 6001326,
  "url":  "https://example.zendesk.com/api/v2/target_failures/6001326.json",
  "target_name": "My URL Target",
  "status_code": 401,
  "message": "Unauthorized",
  "created_at": "2017-09-05T10:38:52Z",
  "consecutive_failure_count": 1,
  "raw_request": "GET /api/v2/tickets.json HTTP/1.1\r\nUser-Agent: Zendesk Target\r\n ...",
  "raw_response": "HTTP/1.1 401 Unauthorized\r\nServer: nginx\r\n ..."
}

List Target Failures

GET /api/v2/target_failures

Stability
  • Development
Allowed For
  • Agents
Using curl
curl https://{subdomain}.zendesk.com/api/v2/target_failures.json \
  -v -u {email_address}:{password}
Example Response
Status: 200 OK

{
  "target_failures": [
    {
      "id":   1,
      "target_name": "My URL Target",
      "status_code": 401
      ...
    },
    {
      "id":   2,
      "target_name": "My URL Target",
      "status_code": 401
      ...
    }
  ]
}

Show Target Failure

GET /api/v2/target_failures/{id}

Stability
  • Development
Allowed For
  • Agents
Using curl
curl https://{subdomain}.zendesk.com/api/v2/target_failures/{id}.json \
  -v -u {email_address}:{password}
Example Response
Status: 200 OK

{
  "target_failure": {
    "id":   1,
    "target_name": "My URL Target",
    "status_code": 401,
    "raw_request": "GET /api/v2/tickets.json HTTP/1.1\r\nUser-Agent: Zendesk Target\r\n ...",
    "raw_response": "HTTP/1.1 401 Unauthorized\r\nServer: nginx\r\n ..."
    ...
  }
}