setAudience(String sessionID, NameValuePairImpl[] audienceID,
String audienceLevel, NameValuePairImpl[] parameters)
![]() |
sessionID - セッション ID を識別する文字列。
|
![]() |
audienceID - オーディエンス ID を定義する NameValuePairImpl オブジェクトの配列。
|
![]() |
audienceLevel - オーディエンス・レベルを定義する文字列。
|
![]() |
parameters - setAudience を使用して渡す必要のあるパラメーターを識別する NameValuePairImpl オブジェクト。これらの値はセッション・データに格納され、セグメンテーションに使用できます。
|
NameValuePair custId2 = new NameValuePairImpl();
custId2.setName("CustomerId");
custId2.setValueAsNumeric(123.0);
custId2.setValueDataType(NameValuePair.DATA_TYPE_NUMERIC);
NameValuePair[] newAudienceId = { custId2 };
/** Parameters can be passed in as well. For this example, there are no parameters,
* therefore pass in null */
NameValuePair[] noParameters=null;
/** Make the call */
response = api.setAudience(sessionId, newAudienceId, audienceLevel, noParameters);
/** Process the response appropriately */
// check if response is successful or not
if(response.getStatusCode() == Response.STATUS_SUCCESS)
{
System.out.println("setAudience call processed with no warnings or errors");
}
else if(response.getStatusCode() == Response.STATUS_WARNING)
{
System.out.println("setAudience call processed with a warning");
}
else
{
System.out.println("setAudience call processed with an error");
}
// For any non-successes, there should be advisory messages explaining why
if(response.getStatusCode() != Response.STATUS_SUCCESS)
printDetailMessageOfWarningOrError("setAudience",
response.getAdvisoryMessages());
Copyright IBM Corporation 2013. All Rights Reserved.
|