概要
Yield Analytics API とサービスは、REST ベースのインターフェイスを介して公開されます。 これは、Web 2.0、AJAX、REST、およびサービス指向の開発プラットフォームの経験を持つ開発者にとって、カスタム機能の開発を快適にすることを目的としています。 開発者は、Yield Analytics API とサービスを使用して開発を試みる前に、AJAX、XML、JSON、HTTP(S) プロトコルなどの Web ベースのアプリケーション パラダイムに精通している必要があります。
Attribute Service は現在、以下に関連するインターフェイスを公開しています。
- 属性変換の作成
- 属性変換の参照
コンテンツ タイプ
サービス REST API は現在、次のコンテンツ タイプをサポートするように設計されています。
- JSON - 使用
Content-type: application/json
目的のコンテンツ タイプの選択は、API 開発者がケースバイケースで選択する必要があります。 API 機能はコンテンツ タイプ間で対称です。 API 開発者は、HTTP GET または POST メソッド パラメーターで、または AJAX または HTTP クライアント ライブラリを使用して、必要なコンテンツ タイプを指定できます。
エラー チェックと状態コード
API 開発者は、サービス REST API から返される HTTP 応答コードをチェックして、API 呼び出しから伝播されたエラーを検出する必要があります。 サービスへの呼び出しが成功すると、200 の範囲の応答コードが生成されます。 HTTP 応答の範囲が 400 から 500 の場合は、エラーを示します。 特定の応答コードとテキストは、API のベータ版開発中に変更される可能性がありますが、範囲は変更されません。
セキュリティ
サービス API は、アプリケーション データを安全な方法で公開します。 API 機能の使用は認証されたユーザーに限定され、セキュリティで保護されたトランスポート プロトコルを介して公開されます。 API へのアクセスは、次のコンテキスト内で行われる必要があります。
認証
認証の詳細については、「 Yield Analytics API - 認証プロセス」を参照してください。
機密性
機密性は、Secure Socket Layer ベースの通信を使用して Yield Analytics API と対話することで維持されます。 API 開発者は、可能な限り、安全でない通信が HTTP よりも HTTPS を使用することを優先する必要があります。 Web ブラウザー コンテキストの外部で開発する場合に HTTP over SSL を有効にする方法については、HTTP クライアント ライブラリを参照してください。
ホスト
https://api.appnexus.com/imf
Paths
外部 ID を Yield Analytics 式辞書に変換する
POST /api/v1/rest/attributes/convert
説明
Yield Analytics ターゲティング語彙に変換するために、属性と属性値の外部 ID を渡します。
Parameters
種類 名前 説明 必須 Schema 既定値 BodyParameter attributeConverter attributeConverter true AttributeConverter 該当なし HeaderParameter username Yield Analytics API にアクセスするためのユーザー名 true string 該当なし HeaderParameter password Yield Analytics API にアクセスするためのパスワード true string 該当なし 応答
HTTP コード 説明 Schema 200 OK StringResponse 実行する
application/json
生成する
application/json
Tags
属性リソース
cURL 要求の例
$ curl 'https://api.appnexus.com/imf/api/v1/rest/attributes/create' -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'username: {{username}}' -H 'password: {{password}}' -d '{ "attributeTranslation" : { "inputAttribute" : "attribute1", "inputValue" : "value1", "targetAttribute" : "targetattribute1", "targetValue" : "targetValue1", "adServerType" : "XFP", "invincible" : false } }'HTTP 要求の例
POST /api/v1/rest/attributes/create HTTP/1.1 Content-Type: application/json Accept: application/json username: {{username}} password: {{password}} Host: https://api.appnexus.com/imf Content-Length: 235 { "attributeTranslation" : { "inputAttribute" : "attribute1", "inputValue" : "value1", "targetAttribute" : "targetattribute1", "targetValue" : "targetValue1", "adServerType" : "XFP", "invincible" : false } }HTTP 応答の例
HTTP/1.1 200 OK Content-Type: application/json;charset=UTF-8 Content-Length: 26 { "result" : "Created" }
新しい属性変換を作成する
POST /api/v1/rest/attributes/create
説明
これにより、JSON 形式のファイルのみが受け入れられ、解析され、Yield Analytics データベースに新しい属性が作成されます。
Parameters
種類 名前 説明 必須 Schema 既定値 BodyParameter attributeTranslation attributeTranslation true AttributeTranslation 該当なし HeaderParameter username Yield Analytics API にアクセスするためのユーザー名 true string 該当なし HeaderParameter password Yield Analytics API にアクセスするためのパスワード true string 該当なし 応答
HTTP コード 説明 Schema 200 OK StringResponse 実行する
application/json
生成する
application/json
Tags
属性リソース
cURL 要求の例
$ curl 'https://api.appnexus.com/imf/api/v1/rest/attributes/create' -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'username: {{username}}' -H 'password: {{password}}' -d '{ "attributeTranslation" : { "inputAttribute" : "attribute1", "inputValue" : "value1", "targetAttribute" : "targetattribute1", "targetValue" : "targetValue1", "adServerType" : "XFP", "invincible" : false } }'HTTP 要求の例
POST /api/v1/rest/attributes/create HTTP/1.1 Content-Type: application/json Accept: application/json username: {{username}} password: {{password}} Host: https://api.appnexus.com/imf Content-Length: 235 { "attributeTranslation" : { "inputAttribute" : "attribute1", "inputValue" : "value1", "targetAttribute" : "targetattribute1", "targetValue" : "targetValue1", "adServerType" : "XFP", "invincible" : false } }HTTP 応答の例
HTTP/1.1 200 OK Content-Type: application/json;charset=UTF-8 Content-Length: 26 { "result" : "Created" }
定義
AttributeConverter
| 名前 | 説明 | 必須 | Schema |
|---|---|---|---|
| attributeConverter | false | AttributeConverter | |
| attributeName | 属性名 | true | string |
| dfpTargetingIds | コンマ区切りで翻訳する DFP ID。 | true | string |
| operator | 演算子は [包含] または [除外] のいずれかです。 | true | string |
AttributeTranslation
| 名前 | 説明 | 必須 | Schema |
|---|---|---|---|
| adServerType | 属性変換の adServer タイプ | true | string |
| attributeTranslation | AttributeTranslation | ||
| inputAttribute | 属性変換の入力属性 | true | string |
| inputValue | 属性変換の入力値 | true | string |
| Invincible | 属性変換の無敵フィールド | true | ブール値 |
| targetAttribute | 属性変換のターゲット属性 | true | string |
| targetValue | 属性変換のターゲット値 | true | string |
StringResponse
API クエリの文字列結果を保持する JSON オブジェクト。
| 名前 | 説明 | 必須 | Schema |
|---|---|---|---|
| result | 操作の結果。 | true | string |