Webhook API

1. Introduction

Webhook notifications set from the SmartBeat console follow the specifications below when sending requests. You may prepare a server to receive these notices, or use a service like Zapier, to receive event notices on arbitrary endpoints. (Such as chat services)

2. Webhook API

2-1. Verification

Endpoint URL verification

 

Example request
POST /my_webhook HTTP/1.1

...
Content-Type: application/json; charset=utf-8
X-Hub-Signature: sha1=2fd5ed887e3d87e3cd86e947864c8f1ecedde71c

{
    "event": "verification",
    "application": {
        "name": "MyApp",
        "platform": "iOS",
        "status": "Development"
    }
}

 

Request Information
Format
JSON
Method
POST

 

リクエストヘッダ
Content-Type
Content Type

"application/json; charset=utf-8" will be set

X-Hub-Signature
Message Signature (HMAC-SHA1)

A SHA-1 hash of the request message body. The API Token is used as the key value. (You may verify the value from the SmartBeat Console, Application General Settings) The receiving server may validate the message was sent from the SmartBeat server by computing a SHA-1 hash of the message body, using the API Token as a key, and comparing the result with this header.

 

Request Body

Sent in JSON format.

event
Event Type

"verification" will be set

application/name
Application Name

The Application Name as registered on the SmartBeat console.

application/platform
Application Platform

iOS | Android | Web

application/status
Application Status

Development | Production

 

Response Status Code
200
Success

The URL will be deemed valid, and may be set on the SmartBeat console by clicking [Update].

All other responses
Error

The URL will be deemed invalid and the setting will not be saved.

2-2. New error

New error notifications

 

Example request
POST /my_webhook HTTP/1.1

...
Content-Type: application/json; charset=utf-8
X-Hub-Signature: sha1=c2b0bf96e202300fb0fe36f817518259d9acdbe1

{
    "event": "new_error",
    "application": {
        "name": "MyApp",
        "platform": "iOS",
        "status": "Development"
    },
    "error": {
        "url": "https://dash.smrtbeat.com/console/error_detail?a=1&e=123456789",
        "count": 1,
        "type": "crash",
        "message": "NSInvalidArgumentException: -[ViewController incorrectSelector]: ...",
        "location": "main.m:main() : 16",
        "application_version": "1.1",
        "os_version": "10.3.1",
        "device": "iPhone 7 [iPhone9,1]",
        "stack_trace": "0 CoreFoundation 0x000000018e83afd8 __exceptionPreprocess() + 120\n..."
    }
}

 

Request Information
Format
JSON
Method
POST

 

Request Header
Content-Type
Content Type

"application/json; charset=utf-8" will be set

X-Hub-Signature
Message Hash (HMAC-SHA1)

A SHA-1 hash of the request message body. The API Token is used as the key value. (You may verify the value from the SmartBeat Console, Application General Settings) The receiving server may validate the message was sent from the SmartBeat server by computing a SHA-1 hash of the message body, using the API Token as a key, and comparing the result with this header.

 

Request Body

Sent in JSON format.

event
Error Type

"new_error" will be set

application/name
Application Name

The Application Name as registered on the SmartBeat console.

application/platform
Application Platform

iOS | Android | Web

application/status
Application Status

Development | Production

error/url
Error detail page URL
error/count
Error occurrence count
error/type
Error Type

crash | signal | exception

error/message
Error message
error/location
Error location
error/application_version
Affected app version
error/os_version
Affected OS version
error/device
Affected device model

* iOS or Android only

error/browser
Affected browser

* Web only

error/stack_trace
Error stacktrace

 

Response status code
2xx
Success

2xx responses will all be interpreted as successful, but please use mainly 200.

404
Not Found

The URL will be deemed as invalid, and further notifications will be stopped. To resume notifications, the Webhook notification URL must be set again using the SmartBeat console.

4xx (excluding 404), 5xx
Error

Before the URL is deemed invalid, a single retry will be sent. (after 10 seconds, or Retry-After seconds if specified)

Any other value
Unexpected

Unexpected responses will be ignored

 

Response Header

Using the response headers below, you may restrict the frequency that SmartBeat will call the API using.

Retry-After
Optional
Retry Time

When returned from an error response, either specify a number of seconds from now, or an absolute time (HTTP-date).

A maximum value of 300 seconds may be specified. If the value is over 300 seconds, it will not be retried.

Use for 4xx (excluding 404) and 5xx responses. This value will be ignored for other responses.

X-RateLimit-Remaining
Optional
API Remaining access count

By returning 0, API accesses will be restricted. During this period, notices will be discarded.

When specified in a 4xx (excluding 404) or 5xx status response, the X-RateLimit-Reset header may be used to specify when this limitation should be lifted. In other cases, the header is ignored.

X-RateLimit-Reset
Optional
API Access reset time

Specify the time when the API Access restriction should be reset. After this time, notices will again be sent to the API.

A maximum value of 24 hours may be specified. Values above 24 hours will be interpreted as 24 hours.

When specified in a 4xx (excluding 404) or 5xx status response, and the X-RateLimit-Remaining header is set to 0, this feature is activated. In other cases, this setting is ignored.