ユーザーAPI/Notification登録
| 名称 | Notification登録 |
|---|---|
| APIバージョン | 1 |
| 認証タイプ | ユーザー認証 |
| URL | https://(APIサーバー名)/services/api/(アクセスコード)/ |
| Method | POST |
| データ形式 | application/x-www-form-urlencoded |
Notificationを登録する。
| 引数名 | 値 | 型 | 必須 | 内容 |
| v | 1(固定) | int定数 | 必須 | バージョン番号 現在は1 |
| c | Bu(固定) | string定数 | 必須 | コマンド Bu = ユーザー認証付きBBAPIを呼び出す |
| Category | ANU(固定) | string定数 | 必須 | オペレーションカテゴリー ANU = Application Notification |
| Operation | poo(固定) | string定数 | 必須 | オペレーション poo = PUTオペレーション |
| AppKey | アプリケーションキー | string | 必須 | アプリケーションキーペアのアプリケーションキー |
| UserAuth | ユーザー認証タイプ | string | 必須 | userhashbb |
| uid | モバイルダイエットID | string | uidまたはloginidのいずれか必須 | ユーザーのモバイルダイエットID |
| loginid | ログインID | string | uidまたはloginidのいずれか必須 | ユーザーのログインID |
| password | パスワードハッシュ値 | hash | 必須 | sha1(アプリケーションシークレット+パスワード) の値 |
| StructData | 登録データ | xml | 必須 | 登録Notificationデータ |
| Format | json,yaml,xml | string定数 | 任意 | 出力フォーマット指定 省略時json(またはアプリケーションキー毎に指定のフォーマット) |
| Charset | UTF-8,SJIS,EUC-JP | string定数 | 任意 | 出力文字コード指定・省略時UTF8 出力フォーマットjson,xml時は常にUTF-8 |
認証パラメーターAppKey,UserAuth,uid,passwordについては、API認証を参照
出力指定パラメーターFormat,Charsetについては、出力フォーマットを参照
NotificationSetタグ: ルートノード Notificationタグ: Notificationのエントリ sdateタグ: 告知すべき日時 actタグ: 推奨する動作 openurl=URLを開く messageタグ: 表示メッセージ urlタグ: 関連するURL overrideタグ: 推奨するオーバーライド処理 true/false
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?> <NotificationSet> <Notification> <sdate>2014/03/24 16:00:00</sdate> <act>openurl</act> <message>告知メッセージA</message> <url>http://this.is.test/mobile/?c=Q456</url> <override>true</override> </Notification> <Notification> <sdate>2014/03/23 17:00:00</sdate> <act>openurl</act> <message>告知メッセージN</message> <url>http://dummy.url/test/?x=Z123</url> <override>false</override> </Notification> </NotificationSet>
| 変数名 | 型 | 内容 |
| api_result | boolean | API実行結果 true:成功 false:失敗 |
| registed | integer | 登録された数 |
| struct | array | 結果の配列 |
結果の配列
| 変数名 | 型 | 内容 |
| result | boolean | 登録処理の結果 |
| objectid | string | 通知オブジェクトID |
{
"api_result":true,
"struct":[
{
"result":true,
"objectid":"ANeae2533351846f6b"
},
{
"result":true,
"objectid":"ANeae25333518554f6"
}
],
"registed":2
}
<?xml version="1.0" encoding="UTF-8"?> <response> <api_result>1</api_result> <struct> <item> <result>1</result> <objectid>ANeae2533352222d07</objectid> </item> <item> <result>1</result> <objectid>ANeae2533352227453</objectid> </item> </struct> <registed>2</registed> </response>
PHPサンプル サンプル/PHP/ユーザーAPI/Notification登録
このドキュメントのバージョン情報
| Version | 1 |
| Revision | 1 |
| Editor | west |