Testing

The echo endpoint lets you test Segment Public API connectivity, responses, versioning, and error handling.

Echo

Public Echo endpoint.

Securitytoken
Request
query Parameters
message
required
string (message)

Sets the response message field. The response contains this field's entry.

This parameter exists in alpha.

Example: message=Hello, World!
delay
number (delay)

The desired response delay, in milliseconds.

This parameter exists in alpha.

triggerError
boolean (triggerError)

If true, returns an HTTP 4xx error that contains the string in message.

This parameter exists in alpha.

triggerMultipleErrors
boolean (triggerMultipleErrors)

If true, returns an HTTP 4xx error that contains the value of the message field in the error message array.

This has no effect if the request sets triggerError.

This parameter exists in alpha.

triggerUnexpectedError
boolean (triggerUnexpectedError)

If true, triggers a 500 error.

This has no effect if the request sets either triggerError or triggerMultipleErrors.

This parameter exists in alpha.

statusCode
number (statusCode)

Sets the HTTP status code to return.

This parameter exists in alpha.

Responses
200

OK

404

Resource not found

422

Validation failure

429

Too many requests

get/echo
Request samples
import { configureApis, unwrap } from '@segment/public-api-sdk-typescript'

const api = configureApis('/* Insert your Public API token here */')

try {
  const result = await unwrap(api.testing.echo('Hello, World!'))
  console.log(JSON.stringify(result))
} catch (e) {
  console.log('ERROR:', e)
}
Response samples
{
  • "data": {
    }
}