属性サービス
概要
Yield Analytics API とサービスは、REST ベースのインターフェイスを介して公開されます。 Web 2.0、AJAX、REST、およびサービス指向の開発プラットフォームで経験した開発者がカスタム機能の開発を快適にすることを目的としています。 開発者は、Yield Analytics API とサービスを使用して開発を試みる前に、AJAX、XML、JSON、HTTP(S) プロトコルなどの Web ベースのアプリケーション パラダイムに精通している必要があります。
属性サービスは現在、次に関連するインターフェイスを公開しています。
- 属性変換の作成
- 属性変換の参照
コンテンツ タイプ
Service REST API は現在、次のコンテンツ タイプをサポートするように設計されています。
- JSON - using
Content-type: application/json
目的のコンテンツ タイプを選択することは、API 開発者がケースバイケースで行う必要がある選択です。 API 機能は、コンテンツ タイプ間で対称的です。 API 開発者は、HTTP GET または POST メソッド パラメーターで、または AJAX または HTTP クライアント ライブラリを使用して、目的のコンテンツ タイプを指定できます。
エラー チェックと状態コード
API 開発者は、サービス REST API から返される HTTP 応答コードをチェックして、API 呼び出しから伝達されたエラーを検出する必要があります。 サービスの呼び出しが成功すると、200 個の範囲応答コードが生成されます。 400 および 500 の範囲の http 応答はエラーを示します。 特定の応答コードとテキストは、API の BETA 開発中に変更される可能性がありますが、範囲は変更されません。
セキュリティ
サービス API は、セキュリティで保護された方法でアプリケーション データを公開します。 API 機能の使用は、認証されたユーザーに制限され、セキュリティで保護されたトランスポート プロトコル経由で公開されます。 API へのアクセスは、次のコンテキスト内で行う必要があります。
cURL認証の例
認証は、各要求で http ヘッダーを介して資格情報を渡すことによって行われます。
- username: curl -H "username:username" - password: curl -H "password:password" - source: curl -H "source:client_id"
HTTPS 認証の例
GET /api/v1/rest/ HTTPS/1.1 Host: yieldanalytics.xandr.com Accept: application/xml, application/json Content-Type: application/json username: {{username}} password: {{password}} source: {{client_id}}
POSTMAN 認証の例
Postman のヘッダー設定の例を次に示します。
注:
- 'Authorization' が "No Auth" に設定されています。次の設定は、[ヘッダー] タブに配置します。
- Postman の使用に関する詳細なチュートリアルについては、「 Yield Analytics API での Postman の使用」を参照してください。
機密性
機密性は、Secure Socket Layer ベースの通信を使用して Yield Analytics API と対話することで維持されます。 API 開発者は、可能な限り HTTP セキュリティで保護されていない通信よりも HTTPS の使用を好む必要があります。 Web ブラウザー コンテキストの外部で開発するときに、SSL 経由で HTTP を有効にする方法については、HTTP クライアント ライブラリを参照してください。
Paths
外部 ID を Yield Analytics 式辞書に変換する
POST /api/v1/rest/attributes/convert
説明
Yield Analytics ターゲット辞書に変換するために、属性と属性値の外部 ID を渡します。
パラメーター
種類 名前 説明 必須 Schema 既定値 BodyParameter attributeConverter attributeConverter true AttributeConverter 該当なし HeaderParameter username Yield Analytics API にアクセスするためのユーザー名 true string 該当なし HeaderParameter password Yield Analytics API にアクセスするためのパスワード true string 該当なし HeaderParameter source Yield Analytics API にアクセスするためのクライアント ソース true string 該当なし 応答
HTTP コード 説明 Schema 200 OK StringResponse 消費
application/json
生成
application/json
Tags
属性リソース
cURL要求の例
$ curl 'https://{{client_url}}/api/v1/rest/v1/rest/attributes/create' -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'username: {{username}}' -H 'password: {{password}}' -H 'source: {{source}}' -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}} source: {{source}} Host: https://{{client_url}}/api/v1/rest 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 データベースに新しい属性が作成されます。
パラメーター
種類 名前 説明 必須 Schema 既定値 BodyParameter attributeTranslation attributeTranslation true AttributeTranslation 該当なし HeaderParameter username Yield Analytics API にアクセスするためのユーザー名 true string 該当なし HeaderParameter password Yield Analytics API にアクセスするためのパスワード true string 該当なし HeaderParameter source Yield Analytics API にアクセスするためのクライアント ソース true string 該当なし 応答
HTTP コード 説明 Schema 200 OK StringResponse 消費
application/json
生成
application/json
Tags
属性リソース
cURL要求の例
$ curl 'https://{{client_url}}/api/v1/rest/v1/rest/attributes/create' -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'username: {{username}}' -H 'password: {{password}}' -H 'source: {{source}}' -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}} source: {{source}} Host: https://{{client_url}}/api/v1/rest 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 |
無敵 | 属性変換の無敵フィールド | true | ブール値 |
targetAttribute | 属性変換のターゲット属性 | true | string |
targetValue | 属性変換のターゲット値 | true | string |
StringResponse
API クエリの文字列結果を保持する JSON オブジェクト。
名前 | 説明 | 必須 | Schema |
---|---|---|---|
result | 操作の結果。 | true | string |