Status Codes and Error Messages

Each request to the REST API returns a standard HTTP 1.1 status code, as defined in the HTTP 1.1 Status Code Definitions (RFC 2616). This HTTP status code indicates whether the request was successful.

Status Code Description

200 OK

Indicates that the request was successful.

All Other Status Codes

Indicates that an error occurred while processing the request.

The response body typically contains an error message that provides additional information as to why the request was denied.

XML schema errors are automatically rejected. As a result, a generic error message is returned as the response body instead of the "Message" response parameter.

Learn how errors are reported.

Learn how to troubleshoot error messages.

2xx Status Code

A 2xx status code indicates that the request was successfully carried out. This means that the request was processed by our servers and the proper response was returned. However, the proper response may be an empty response body. For example, updating an object (i.e, PUT request) will typically return an empty response body.

If an endpoint's request URI requires the identification of a customer, then an invalid account number or custom ID will result in a 400 Bad Request.

GET requests set to an invalid object ID will either return a 200 OK with an empty object or a 400 Bad Request.

Error Reporting

The format for error reporting varies by product.

Generic Format

Error messages for endpoints for most products, with the exception of DefendThe Defend product is designed to provide protection against application layer and volumetric attacks. This product offering consists of the Web Application Firewall (WAF) and the Rate Limiting features. and Real-Time Log DeliveryDelivers near real-time log data to your web server or AWS S3 bucket. (RTLD), are reported in a response parameter called "Message." A sample error message is displayed below in JSON and XML.

Errors are reported differently for the Defend and RTLD products.

Sample JSON error message:

{
	"Message" : "Access Denied"
}

Sample XML error message:

<Error xmlns="http://www.whitecdn.com/schemas/apiservices/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
	<Message>Access Denied</Message>
</Error>

Format - (Defend Endpoints)

Our Web Application Firewall and Rate Limiting endpoints may be requested via the following base URLs:

https://api.transactcdn.com/v2/mcc/customers/Account Number/waf

https://api.transactcdn.com/v2/mcc/customers/Account Number/defend

The response body for an error contains the following response parameters:

Name Data Type Description

errors

Array

Contains an error message.

message

String

Provides a description of the error that occurred.

code

Integer

Indicates a HTTP status code. This status code should only be used for troubleshooting purposes.

success

String

This parameter may be included in the error response for a Rate Limiting configuration endpoint.

This parameter is set to "false" to indicate that the requested action was unsuccessful.

Certain types of errors (e.g., 405 Method Not Allowed) may return a web page describing the error message (e.g., Method not allowed.) instead of the response described above.

A sample JSON response body is provided below.

{
	"errors" : [{
			"message" : "Invalid date range, beginning date too old: 2014-11-08 00:00:00 < 2015-05-04 20:37:53",
			"code" : 400
		}
	]
}

Format - (Real-Time Log Delivery Endpoints)

Request general RTLD endpoints and RTLD CDN-specific ones via one of the following base URLs:

https://api.transactcdn.com/v2/mcc/customers/Account Number/rtld
https://api.transactcdn.com/v2/mcc/rtld

The response body for an error contains the following response parameters:

Name Data Type Description

@type

String

Returns Error.

code

String

Indicates the reason for the error using a high-level code.

Sample value:

invalid_request

title

String

Provides a high-level overview on why the error occurred.

status_code

Integer

Indicates the HTTP status code associated with the response.

Use this status code for troubleshooting purposes.

details

Array

Contains a description of the error.

@type

String

details array

Returns ErrorDetail.

description

String

details array

Provides a description of the error that occurred.

A sample JSON response body is provided below.

{
	"@type": "Error",
	"code": "invalid_request",
	"title": "The request is not valid, please check details for more info.",
	"status_code": 409,
	"details": [{
			"@type": "ErrorDetail",
			"description": "The POST HTTP method may only be used for initial setup. Use the PUT HTTP method instead. Existing resource: https://api.transactcdn.com/v2/mcc/customers/0001/rtld/settings/20"
		}
	]
}