Sample - Slack Web API
GET/api.test

Test an API request

Checks whether the API calling code can make a request and optionally returns a supplied test value. Use error to request an artificial error response and foo to include an example property in the response. This method is useful for validating request handling and response parsing.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

2 parameters
errorstringoptional
Optional string used to request an artificial error response.
foostringoptional
Optional example string property to return in the response.

2 status codes
200Returns an object with `ok` set to true and any requested test properties.
okbooleanrequired
Allowed:true
defaultReturns an object with `ok` set to false and an `error` value describing the artificial failure.
errorstringrequired
okbooleanrequired
Allowed:false

Error handling

error and foo are optional string values. If you provide either parameter, send it as a string and use error only when you want to exercise an artificial error response.