Growth Push API v4
API Overview ¶
Error Codes & Responses
400系リクエストにはそれぞれ4桁のエラーコードを設けております。
10xx : 共通系
11xx : Clients 系
12xx : Tags 系
13xx : Events 系
14xx : TagClients 系
15xx : EventClients 系
99xx : Growthbeat 共通系
API 共通
Code | Text | Description |
---|---|---|
1001 | Invaid credential. | 不正なクレデンシャルキー |
1002 | Application not found. | 指定のアプリケーションが見つかりません |
1003 | Unauthorized. | 認証が必要です |
1004 | Permission denied. | 権限がありません |
1005 | Not found. | 指定のページが見つかりません |
1000 | Unexpected error has occured. | 予期しないエラーが発生しました |
Clients API
Code | Text | Description |
---|---|---|
1101 | Growthbeat client not found. | Growthbeat クライアント が存在しません |
1102 | Client not found. | 指定のクライアントが存在しません |
1103 | The OS is currently not supported. | サポート外のOSです |
1104 | Invalid device token length. | 不正なデバイストークンです |
1105 | Duplicate token. | トークンが重複しています |
1100 | Unexpected error has occured. | 予期しないエラーが発生しました |
Tags API
Code | Text | Description |
---|---|---|
1201 | Tag not found. | 指定のタグが存在しません |
1202 | Duplicate tag. | タグが重複しています |
1203 | Invalid tag type. | 不正なタグのタイプです |
TagClients API
Code | Text | Description |
---|---|---|
1401 | TagClient not found. | 指定のタグクライアントが存在しません |
1402 | Failed to create tagClient. | タグクライアントの作成に失敗しました |
1102 | Client not found. | 指定のクライアントが存在しません |
1201 | Tag not found. | 指定のタグが存在しません |
1203 | Invalid tag type. | 不正なタグのタイプです |
Events API
Code | Text | Description |
---|---|---|
1301 | Event not found. | 指定のイベントが存在しません |
1302 | Duplicate event. | イベントが重複しています |
1303 | Invalid event type. | 不正なイベントのタイプです |
Growthbeat 共通基盤
Code | Text | Description |
---|---|---|
9901 | Bad Request. | 不正なリクエストです |
9902 | Unauthorized. | クレデンシャルキーが異なります |
9903 | Payment Required. | 使用するには支払いが必要な機能です |
9904 | Forbidden. | アクセス権限がありません |
9905 | Not Found. | 指定のページが見つかりません |
9906 | Not Acceptable. | 受け入れ受け入れられない値があります |
9907 | Unsupprted Media Type. | 予期していない値が入力されました |
9908 | Unexpected error has occured. | 予期しないエラーが発生しました |
9909 | Service Unavailable. | サービスを使用できません |
Error Responses
エラーメッセージをJSONフォーマットで返却します。 sutatus
はHTTPレスポンス、 message
はエラーの詳細、 code
はエラーコードを表しています。
{
"status": 400,
"message": "Invaid credential.",
"code": 1001
}
Clients ¶
Client Object
Name | Type | Notes |
---|---|---|
id | string | Growthbeat クライアントID |
applicationId | string | Growthbeat アプリケーションID |
token | string | デバイストークン |
os | enum | OS ( ios | android ) |
status | enum | プッシュ通知ステータス ( unknown | validating | active | inactive | invalid ) |
environment | enum | デバイス環境 ( development | production ) |
updated | string | 更新日 ( YYYY-MM-DD HH:mm:ss ) ※ UTC 時間表記となります |
created | string | 作成日 ( YYYY-MM-DD HH:mm:ss ) ※ UTC 時間表記となります |
Get Client ¶
Get ClientGET/clients/{id}{?applicationId}{&credentialId}
クライアント取得
Example URI
- id
string
(required)Growthbeat クライアントID
- applicationId
string
(required)Growthbeat アプリケーションID
- credentialId
string
(required)Growthbeat クレデンシャルID
200
Headers
Content-Type: application/json
Body
{
"id": "GROWTHBEAT_CLIENT_ID",
"applicationId": "GROWTHBEAT_APPLICATION_ID",
"token": "DEVICE_TOKEN",
"status": "unknown",
"os": "ios",
"environment": "production",
"updated": "2015-02-03 12:34:56",
"created": "2015-02-03 12:34:56"
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"applicationId": {
"type": "string"
},
"token": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"unknown",
"validating",
"active",
"inactive",
"invalid"
]
},
"os": {
"type": "string",
"enum": [
"ios",
"android"
]
},
"environment": {
"type": "string",
"enum": [
"production",
"development"
]
},
"updated": {
"type": "string"
},
"created": {
"type": "string"
}
}
}
Get Client by token ¶
Get Client by tokenGET/clients/token/{token}{?applicationId}{&credentialId}
クライアント取得
Example URI
- token
string
(required)デバイストークン
- applicationId
string
(required)Growthbeat アプリケーションID
- credentialId
string
(required)Growthbeat クレデンシャルID
200
Headers
Content-Type: application/json
Body
{
"id": "GROWTHBEAT_CLIENT_ID",
"applicationId": "GROWTHBEAT_APPLICATION_ID",
"token": "DEVICE_TOKEN",
"status": "unknown",
"os": "ios",
"environment": "production",
"updated": "2015-02-03 12:34:56",
"created": "2015-02-03 12:34:56"
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"applicationId": {
"type": "string"
},
"token": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"unknown",
"validating",
"active",
"inactive",
"invalid"
]
},
"os": {
"type": "string",
"enum": [
"ios",
"android"
]
},
"environment": {
"type": "string",
"enum": [
"production",
"development"
]
},
"updated": {
"type": "string"
},
"created": {
"type": "string"
}
}
}
Get Client by v1 client id ¶
Get Client by v1 client idGET/clients/{?v1ClientId}{&applicationId}{&credentialId}
クライアント取得 (V1 Client APIのクライアントIDを元に)
Example URI
- v1ClientId
number
(required)v1 API ClientID
- applicationId
string
(required)Growthbeat アプリケーションID
- credentialId
string
(required)Growthbeat クレデンシャルID
200
Headers
Content-Type: application/json
Body
{
"id": "GROWTHBEAT_CLIENT_ID",
"applicationId": "GROWTHBEAT_APPLICATION_ID",
"token": "DEVICE_TOKEN",
"status": "unknown",
"os": "ios",
"environment": "production",
"updated": "2015-02-03 12:34:56",
"created": "2015-02-03 12:34:56"
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"applicationId": {
"type": "string"
},
"token": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"unknown",
"validating",
"active",
"inactive",
"invalid"
]
},
"os": {
"type": "string",
"enum": [
"ios",
"android"
]
},
"environment": {
"type": "string",
"enum": [
"production",
"development"
]
},
"updated": {
"type": "string"
},
"created": {
"type": "string"
}
}
}
Get Clients ¶
Get ClientsGET/clients{?applicationId}{&credentialId}{&limit}{&exclusiveStartId}
クライアント一覧取得(降順取得固定)
Example URI
- applicationId
string
(required)Growthbeat アプリケーションID
- credentialId
string
(required)Growthbeat クレデンシャルID
- limit
number
(optional) Default: 100max: 100 min: 1
- exclusiveStartId
string
(optional)指定の
clientId
の次の値を取得します
200
Headers
Content-Type: application/json
Body
[
{
"id": "GROWTHBEAT_CLIENT_ID",
"applicationId": "GROWTHBEAT_APPLICATION_ID",
"token": "DEVICE_TOKEN",
"status": "unknown",
"os": "ios",
"environment": "production",
"updated": "2015-02-03 12:34:56",
"created": "2015-02-03 12:34:56"
}
]
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}
Create New Client ¶
Create New ClientPOST/clients
新規クライアント作成
- SDK と併用する場合、データの上書きが発生するため、SDK での更新が無効になる場合がございます。
Example URI
Headers
Content-Type: application/x-www-form-urlencoded
Body
{
"applicationId": "GROWTHBEAT_APPLICATION_ID",
"credentialId": "GROWTHBEAT_CREDENTIAL_ID",
"token": "DEVICE_TOKEN",
"os": "ios",
"environment": "production"
}
Schema
{
"type": "object",
"properties": {
"applicationId": {
"type": "string",
"description": "Growthbeat アプリケーションID"
},
"credentialId": {
"type": "string",
"description": "Growthbeat クレデンシャルID"
},
"token": {
"type": "string",
"description": "デバイストークン"
},
"os": {
"enum": [
"ios",
"android"
],
"description": "OS"
},
"environment": {
"enum": [
"production",
"development"
],
"description": "デバイス環境"
}
},
"required": [
"applicationId",
"credentialId",
"token",
"os",
"environment"
],
"$schema": "http://json-schema.org/draft-04/schema#"
}
200
Headers
Content-Type: application/json
Body
{
"id": "GROWTHBEAT_CLIENT_ID",
"applicationId": "GROWTHBEAT_APPLICATION_ID",
"token": "DEVICE_TOKEN",
"status": "unknown",
"os": "ios",
"environment": "production",
"updated": "2015-02-03 12:34:56",
"created": "2015-02-03 12:34:56"
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"applicationId": {
"type": "string"
},
"token": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"unknown",
"validating",
"active",
"inactive",
"invalid"
]
},
"os": {
"type": "string",
"enum": [
"ios",
"android"
]
},
"environment": {
"type": "string",
"enum": [
"production",
"development"
]
},
"updated": {
"type": "string"
},
"created": {
"type": "string"
}
}
}
400
Headers
Content-Type: application/json
Body
{
"status": 400,
"message": "Growthbeat Client id cannot be longer than 16 characters."
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status": {
"type": "number",
"description": "ステータスコード"
},
"message": {
"type": "string",
"description": "不正な値の説明"
}
}
}
Update a Client token ¶
Update a Client tokenPUT/clients/{id}/token
デバイストークンの更新
- SDK と併用する場合、データの上書きが発生するため、SDK での更新が無効になる場合がございます。
Example URI
- id
string
(required)Growthbeat クライアントID
Headers
Content-Type: application/x-www-form-urlencoded
Body
{
"applicationId": "GROWTHBEAT_APPLICATION_ID",
"credentialId": "GROWTHBEAT_CREDENTIAL_ID",
"token": "DEVICE_TOKEN"
}
Schema
{
"type": "object",
"properties": {
"applicationId": {
"type": "string",
"description": "Growthbeat アプリケーションID"
},
"credentialId": {
"type": "string",
"description": "Growthbeat クレデンシャルID"
},
"token": {
"type": "string",
"description": "デバイストークン"
}
},
"required": [
"applicationId",
"credentialId"
],
"$schema": "http://json-schema.org/draft-04/schema#"
}
200
Headers
Content-Type: application/json
Body
{
"id": "GROWTHBEAT_CLIENT_ID",
"applicationId": "GROWTHBEAT_APPLICATION_ID",
"token": "DEVICE_TOKEN",
"status": "unknown",
"os": "ios",
"environment": "production",
"updated": "2015-02-03 12:34:56",
"created": "2015-02-03 12:34:56"
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"applicationId": {
"type": "string"
},
"token": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"unknown",
"validating",
"active",
"inactive",
"invalid"
]
},
"os": {
"type": "string",
"enum": [
"ios",
"android"
]
},
"environment": {
"type": "string",
"enum": [
"production",
"development"
]
},
"updated": {
"type": "string"
},
"created": {
"type": "string"
}
}
}
Update a Client status ¶
Update a Client statusPUT/clients/{id}/status
クライアントのステータス環境更新
- SDK と併用する場合、データの上書きが発生するため、SDK での更新が無効になる場合がございます。
Status | Description |
---|---|
active | ステータスを強制的に active に変更します。同一デバイスに紐づく複数デバイストークンを active にした場合、 重複配信 される可能性があります。 |
validating | プッシュ通知可能なデバイスか検証した後、通知可能なデバイスは active に、通知を拒否しているデバイス、またはアンインストール済みのデバイスは inactive に変化します。 |
unknown | ステータスを unknown に変更します。この更新を行うとデバイスに通知が届かなくなります。 |
inactive | ステータスを inactive に変更します。この更新を行うとデバイスに通知が届かなくなります。 |
invalid | ステータスを invalid に変更します。この更新を行うとデバイスに通知が届かなくなります。 |
Example URI
- id
string
(required)Growthbeat クライアントID
Headers
Content-Type: application/x-www-form-urlencoded
Body
{
"applicationId": "GROWTHBEAT_APPLICATION_ID",
"credentialId": "GROWTHBEAT_CREDENTIAL_ID",
"status": "unknown"
}
Schema
{
"type": "object",
"properties": {
"applicationId": {
"type": "string",
"description": "Growthbeat アプリケーションID"
},
"credentialId": {
"type": "string",
"description": "Growthbeat クレデンシャル"
},
"status": {
"enum": [
"unknown",
"validating",
"active",
"inactive",
"invalid"
]
}
},
"required": [
"applicationId",
"credentialId"
],
"$schema": "http://json-schema.org/draft-04/schema#"
}
200
Headers
Content-Type: application/json
Body
{
"id": "GROWTHBEAT_CLIENT_ID",
"applicationId": "GROWTHBEAT_APPLICATION_ID",
"token": "DEVICE_TOKEN",
"status": "unknown",
"os": "ios",
"environment": "production",
"updated": "2015-02-03 12:34:56",
"created": "2015-02-03 12:34:56"
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"applicationId": {
"type": "string"
},
"token": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"unknown",
"validating",
"active",
"inactive",
"invalid"
]
},
"os": {
"type": "string",
"enum": [
"ios",
"android"
]
},
"environment": {
"type": "string",
"enum": [
"production",
"development"
]
},
"updated": {
"type": "string"
},
"created": {
"type": "string"
}
}
}
TagClients ¶
- デバイスに紐づくタグの情報を取得できます。
TagClient Object
Name | Type | Notes |
---|---|---|
tagId | number | タグID |
clientId | string | Growthbeat クライアントID |
value | string | 任意の値 |
Get TagClients by tag ¶
Get TagClients by tagGET/tag_clients/tag/{tagId}{?applicationId}{&credentialId}
タグに紐づくクライアントを取得(降順取得固定)
Example URI
- tagId
number
(required)タグID
- applicationId
string
(required)Growthbeat アプリケーションID
- credentialId
string
(required)Growthbeat クレデンシャルID
- limit
number
(optional) Default: 100max: 100 min: 1
- exclusiveStartClientId
string
(optional)指定の
clientId
の次の値を取得します
200
Headers
Content-Type: application/json
Body
[
{
"tagId": 0,
"clientId": "GROWTHBEA_CLIENT_ID",
"value": "VALUE"
}
]
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}
Get TagClients by client ¶
Get TagClients by clientGET/tag_clients/client/{clientId}{?applicationId}{&credentialId}
クライアントに紐づくタグを取得
- 最新の登録タグ100件の中から合致するものを抽出いたします。101件以上ある場合、検索結果が安定いたしません、ご注意下さい。
Example URI
- clientId
string
(required)Growthbeat クライアントID
- applicationId
string
(required)Growthbeat アプリケーションID
- credentialId
string
(required)Growthbeat クレデンシャルID
200
Headers
Content-Type: application/json
Body
[
{
"tagId": 0,
"clientId": "GROWTHBEA_CLIENT_ID",
"value": "VALUE"
}
]
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}
Create New TagClient ¶
Create New TagClientPOST/tag_clients
新規タグクライアント作成
- 既にタグクライアントが登録されている場合は、 value を更新します。
Example URI
Headers
Content-Type: application/x-www-form-urlencoded
Body
{
"applicationId": "GROWTHBEAT_APPLICATION_ID",
"credentialId": "GROWTHBEAT_CREDENTIAL_ID",
"clientId": "GROWTHBEAT_CLIENT_ID",
"tagId": 0,
"value": "value"
}
Schema
{
"type": "object",
"properties": {
"applicationId": {
"type": "string",
"description": "Growthbeat アプリケーションID"
},
"credentialId": {
"type": "string",
"description": "Growthbeat クレデンシャルID"
},
"clientId": {
"type": "string",
"description": "Growthbeat クライアントID"
},
"tagId": {
"type": "number",
"description": "タグID"
},
"value": {
"type": "string",
"description": "任意の値"
}
},
"required": [
"applicationId",
"credentialId",
"clientId",
"tagId"
],
"$schema": "http://json-schema.org/draft-04/schema#"
}
200
Headers
Content-Type: application/json
Body
{
"tagId": 0,
"clientId": "GROWTHBEA_CLIENT_ID",
"value": "VALUE"
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"tagId": {
"type": "number"
},
"clientId": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
Events ¶
Event Object
Name | Type | Notes |
---|---|---|
id | number | イベントID |
applicationId | string | Growthbeat アプリケーションID |
type | enum | イベントのタイプ ( custom | message ) |
name | string | イベント名 |
created | string | 作成日 ( YYYY-MM-DD HH:mm:ss ) ※ UTC 時間表記となります |
Get Event ¶
Get EventGET/events/{id}{?applicationId}{&credentialId}
イベント取得
Example URI
- id
number
(required)イベントID
- applicationId
string
(required)Growthbeat アプリケーションID
- credentialId
string
(required)Growthbeat クレデンシャルID
200
Headers
Content-Type: application/json
Body
{
"id": 0,
"applicationId": "GRWOTHBEAT_APPLICATION_ID",
"type": "custom",
"name": "EVENT_NAME",
"created": "2015-02-03 12:34:56"
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"applicationId": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"custom",
"message"
]
},
"name": {
"type": "string"
},
"created": {
"type": "string"
}
}
}
Get Events ¶
Get EventsGET/events{?applicationId}{&credentialId}
イベント一覧取得(降順取得固定)
Example URI
- applicationId
string
(required)Growthbeat アプリケーションID
- credentialId
string
(required)Growthbeat クレデンシャルID
- limit
number
(optional) Default: 100max: 100 min: 1
- exclusiveStartId
number
(optional)指定の
eventId
の次の値を取得します- type
string
(optional) Default: customタグタイプ
200
Headers
Content-Type: application/json
Body
[
{
"id": 0,
"applicationId": "GRWOTHBEAT_APPLICATION_ID",
"type": "custom",
"name": "EVENT_NAME",
"created": "2015-02-03 12:34:56"
}
]
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}
Create New Event ¶
Create New EventPOST/events
新規イベント作成
- 作成済イベント(削除済であっても)と同じ
name
のイベントは作成できません
Example URI
Headers
Content-Type: application/x-www-form-urlencoded
Body
{
"applicationId": "GROWTHBEAT_APPLICATION_ID",
"credentialId": "GROWTHBEAT_CREDENTIAL_ID",
"name": "EVENT_NAME"
}
Schema
{
"type": "object",
"properties": {
"applicationId": {
"type": "string",
"description": "Growthbeat アプリケーションID"
},
"credentialId": {
"type": "string",
"description": "Growthbeat クレデンシャルID"
},
"name": {
"type": "string",
"description": "イベント名"
}
},
"required": [
"applicationId",
"credentialId",
"name"
],
"$schema": "http://json-schema.org/draft-04/schema#"
}
200
Headers
Content-Type: application/json
Body
{
"id": 0,
"applicationId": "GRWOTHBEAT_APPLICATION_ID",
"type": "custom",
"name": "EVENT_NAME",
"created": "2015-02-03 12:34:56"
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"applicationId": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"custom",
"message"
]
},
"name": {
"type": "string"
},
"created": {
"type": "string"
}
}
}
EventClients ¶
EventClient Object
Name | Type | Notes |
---|---|---|
eventId | number | イベントID |
clientId | string | Growthbeat クライアントID |
value | string | 任意の値 |
timestamp | number | 作成日 (ナノ秒単位) |
Create New EventClient ¶
Create New EventClientPOST/event_clients
新規イベントクライアント作成
Example URI
Headers
Content-Type: application/x-www-form-urlencoded
Body
{
"applicationId": "GROWTHBEAT_APPLICATION_ID",
"credentialId": "GROWTHBEAT_CREDENTIAL_ID",
"clientId": "GROWTHBEAT_CLIENT_ID",
"eventId": 0,
"value": "VALUE"
}
Schema
{
"type": "object",
"properties": {
"applicationId": {
"type": "string",
"description": "Growthbeat アプリケーションID"
},
"credentialId": {
"type": "string",
"description": "Growthbeat クレデンシャルID"
},
"clientId": {
"type": "string",
"description": "Growthbeat クライアントID"
},
"eventId": {
"type": "number",
"description": "イベントID"
},
"value": {
"type": "string",
"description": "任意の値"
}
},
"required": [
"applicationId",
"credentialId",
"clientId",
"eventId"
],
"$schema": "http://json-schema.org/draft-04/schema#"
}
200
Headers
Content-Type: application/json
Body
{
"eventId": 0,
"clientId": "GROWTHBEA_CLIENT_ID",
"value": "VALUE",
"timestamp": 0
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"eventId": {
"type": "number"
},
"clientId": {
"type": "string"
},
"value": {
"type": "string"
},
"timestamp": {
"type": "number"
}
}
}