[[FrontPage]]

&size(24){ユーザーAPI/Notification取得};

* API情報 [#q6190828]

|~名称|Notification取得|
|~APIバージョン|1|
|~認証タイプ|ユーザー認証|
|~URL|https://(APIサーバー名)/services/api/(アクセスコード)/|
|~Method|POST|
|~データ形式|application/x-www-form-urlencoded|

* 概要 [#jfe13a2c]

現在時刻より過去に通知時刻が設定されたNotificationを取得する。


* パラメーター [#ya59d11f]

|引数名|値|型|必須|内容|h
|v|1(固定)|int定数|必須|バージョン番号&br;現在は1|
|c|Bu(固定)|string定数|必須|コマンド&br;Bu = ユーザー認証付きBBAPIを呼び出す|
|Category|ANU(固定)|string定数|必須|オペレーションカテゴリー&br;ANU = Application Notification|
|Operation|gsl(固定)|string定数|必須|オペレーション&br;gsl = GETSUMMARYLISTオペレーション|
|AppKey|アプリケーションキー|string|必須|アプリケーションキーペアのアプリケーションキー|
|UserAuth|ユーザー認証タイプ|string|必須|userhashbb|
|uid|モバイルダイエットID|string|uidまたはloginidのいずれか必須|ユーザーのモバイルダイエットID|
|loginid|ログインID|string|uidまたはloginidのいずれか必須|ユーザーのログインID|
|password|パスワードハッシュ値|hash|必須|sha1(アプリケーションシークレット+パスワード) の値|
|Format|json,yaml,xml|string定数|任意|出力フォーマット指定&br;省略時json(またはアプリケーションキー毎に指定のフォーマット)|
|Charset|UTF-8,SJIS,EUC-JP|string定数|任意|出力文字コード指定・省略時UTF8&br;出力フォーマットjson,xml時は常にUTF-8|
認証パラメーターAppKey,UserAuth,uid,passwordについては、[[API認証>API認証#authtype_user]]を参照~
出力指定パラメーターFormat,Charsetについては、[[出力フォーマット]]を参照~


* 返値 [#e86e04c1]

|変数名|型|内容|h
|api_result|boolean|API実行結果&br;true:成功 false:失敗|
|count|integer|結果データの数|
|struct|array|結果データの配列|

結果データの配列
|変数名|型|内容|h
|objectid|string|NotificationオブジェクトID|
|sdate|string|告知すべき日時|
|act|string|推奨する動作 openurl=URLを開く|
|message|string|表示メッセージ|
|url|string|関連するURL|
|override|string|推奨するオーバーライド処理 true/false|

** JSONの例 [#a81f6668]
#html{{
<pre class="brush:xml;">
{
	"api_result":true,
	"count":2,
	"struct":[
		{
			"objectid":"ANeae25330e8dc2bc3",
			"sdate":"2014\/03\/23 17:00:00",
			"act":"openurl",
			"message":"\u544a\u77e5\u30e1\u30c3\u30bb\u30fc\u30b8N",
			"url":"http:\/\/this.is.test\/mobile\/?c=Z123",
			"override":"true"
		},
		{
			"objectid":"ANeae25330e8dc74db",
			"sdate":"2014\/03\/24 16:00:00",
			"act":"openurl",
			"message":"\u544a\u77e5\u30e1\u30c3\u30bb\u30fc\u30b8A",
			"url":"http:\/\/this.is.test\/mobile\/?c=Q456",
			"override":"true"
		}
	]
}
</pre>
}}

** XMLの例 [#a81f6668]
#html{{
<pre class="brush:xml;">
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;response&gt;
	&lt;api_result&gt;1&lt;/api_result&gt;
	&lt;count&gt;2&lt;/count&gt;
	&lt;struct&gt;
		&lt;item&gt;
			&lt;objectid&gt;ANeae25330e8dc2bc3&lt;/objectid&gt;
			&lt;sdate&gt;2014/03/23 17:00:00&lt;/sdate&gt;
			&lt;act&gt;openurl&lt;/act&gt;
			&lt;message&gt;告知メッセージN&lt;/message&gt;
			&lt;url&gt;http://this.is.test/mobile/?c=Z123&lt;/url&gt;
			&lt;override&gt;true&lt;/override&gt;
		&lt;/item&gt;
		&lt;item&gt;
			&lt;objectid&gt;ANeae25330e8dc74db&lt;/objectid&gt;
			&lt;sdate&gt;2014/03/24 16:00:00&lt;/sdate&gt;
			&lt;act&gt;openurl&lt;/act&gt;
			&lt;message&gt;告知メッセージA&lt;/message&gt;
			&lt;url&gt;http://this.is.test/mobile/?c=Q456&lt;/url&gt;
			&lt;override&gt;true&lt;/override&gt;
		&lt;/item&gt;
	&lt;/struct&gt;
&lt;/response&gt;
</pre>
}}

* サンプル [#z5db7844]

PHPサンプル [[サンプル/PHP/ユーザーAPI/Notification取得]]

* バージョン [#o0becc47]

このドキュメントのバージョン情報
|Version|1|
|Revision|1|
|Editor|west|

トップ   差分 履歴 リロード   一覧 検索 最終更新   ヘルプ   最終更新のRSS