FrontPage

ユーザーAPI/Notification登録

API情報

名称Notification登録
APIバージョン1
認証タイプユーザー認証
URLhttps://(APIサーバー名)/services/api/(アクセスコード)/
MethodPOST
データ形式application/x-www-form-urlencoded

概要

Notificationを登録する。

パラメーター

引数名必須内容
v1(固定)int定数必須バージョン番号
現在は1
cBu(固定)string定数必須コマンド
Bu = ユーザー認証付きBBAPIを呼び出す
CategoryANU(固定)string定数必須オペレーションカテゴリー
ANU = Application Notification
Operationpoo(固定)string定数必須オペレーション
poo = PUTオペレーション
AppKeyアプリケーションキーstring必須アプリケーションキーペアのアプリケーションキー
UserAuthユーザー認証タイプstring必須userhashbb
uidモバイルダイエットIDstringuidまたはloginidのいずれか必須ユーザーのモバイルダイエットID
loginidログインIDstringuidまたはloginidのいずれか必須ユーザーのログインID
passwordパスワードハッシュ値hash必須sha1(アプリケーションシークレット+パスワード) の値
StructData登録データxml必須登録Notificationデータ
Formatjson,yaml,xmlstring定数任意出力フォーマット指定
省略時json(またはアプリケーションキー毎に指定のフォーマット)
CharsetUTF-8,SJIS,EUC-JPstring定数任意出力文字コード指定・省略時UTF8
出力フォーマットjson,xml時は常にUTF-8

認証パラメーターAppKey,UserAuth,uid,passwordについては、API認証を参照
出力指定パラメーターFormat,Charsetについては、出力フォーマットを参照

登録データXML

データ定義XML構成

NotificationSetタグ: ルートノード
Notificationタグ: Notificationのエントリ
sdateタグ: 告知すべき日時
actタグ: 推奨する動作 openurl=URLを開く
messageタグ: 表示メッセージ
urlタグ: 関連するURL
overrideタグ: 推奨するオーバーライド処理 true/false

XML例

<?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_resultbooleanAPI実行結果
true:成功 false:失敗
registedinteger登録された数
structarray結果の配列

結果の配列

変数名内容
resultboolean登録処理の結果
objectidstring通知オブジェクトID

JSONの例

{
	"api_result":true,
	"struct":[
		{
			"result":true,
			"objectid":"ANeae2533351846f6b"
		},
		{
			"result":true,
			"objectid":"ANeae25333518554f6"
		}
	],
	"registed":2
}

XMLの例

<?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登録

バージョン

このドキュメントのバージョン情報

Version1
Revision1
Editorwest

トップ   差分 履歴 リロード   一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2018-06-22 (金) 08:06:24