Segmentation Service API Reference

A segment is the definition that represents set of users that fall under certain criteria of current behavior, historic actions & attributes or higher propensity for being part of specific future event. You must use these APIs to get access to the various segment values of the users.

A request can be made from an app that runs in the server side or the client side. Since the secret key has to be hashed and sent along with the request, it is advisable to make this call from the server side application and not from client side. Please refer to our PHP / JavaScript sample code in the Integration Guide.

Request

The following message prototype describes the structure of the HTTP request. The prototype lists all fields that could be included in the message. The fields are alphabetized to help you locate fields more quickly. To learn more about an individual field or its type, click its name in the box (or scroll down to find it in the table below the prototype).

S.No Field Type Occurrence Description
1 End Point URL String Required Basic End point
2 ProspectScore String Required

The Segment for which the value is sought and the format in which the response should be sent.

The Segment Name can be:

  • ActivityClass
  • TransactionFrequency
  • TransactionRecency
  • TransactionRecency
  • ProspectScore

The Type can be:

  • JSON
  • XML
3 email String Required Email Address of the user for which the segment value is sought
4 clientId String Required clientId issued when you registered your app first.
5 verifyString String Required Items 1 - 4 concatenated and URL encoded
6 signature String Required Hash 256 generated for items 1-4 concatenated with the client secret key that was issued along with the clientId

Response Payload

The following message prototype describes the structure of the response payload in JSON format. The prototype lists all fields that could be included in the message. The fields are alphabetized to help you locate fields more quickly. To learn more about an individual field or its type, click its name in the box (or scroll down to find it in the table below the prototype).

S.No Field Type Description
1 scores Array of string An array object containing the score for the segment requested
2 email String Email address of the customer for whom the score was requested
3 scoreName String Name of the segment for which the value was requested
4 score String Actual value of the segment that the user belongs to
5 comment String Description about the value of the segment

Samples

Request

[https://api.identity.x.com/scores/ActivityClass.json?email=BarneyRubble@scorestest.com&clientId=EFDDHdgQYH12pZoDO9hTCvuG7OVf4hLx4Bz5iSn6PGCT41&verifyString=http%3A%2F%2Franga.arathika.com%2Fscores%2FActivityClass.json%3Femail%3DBarneyRubble%40scorestest.com%26clientId%3DEFHdgQDH10pZoDO9hTCvuG7OVf4hLx4Bz5iSn6PGCT41&signature=DADTtUMWzl85pXWQBAvTERTGRwVu79xiAs%2Fj0aOGF%2Ffg%3D] |

[https://api.identity.x.com/scores/transactionFrequency.xml?email=BarneyRubble@scorestest.com&clientId=EFDDHdgQYH12pZoDO9hTCvuG7OVf4hLx4Bz5iSn6PGCT41&verifyString=http%3A%2F%2Franga.arathika.com%2Fscores%2FActivityClass.json%3Femail%3DBarneyRubble%40scorestest.com%26clientId%3DEFHdgQDH10pZoDO9hTCvuG7OVf4hLx4Bz5iSn6PGCT41&signature=DADTtUMWzl85pXWQBAvTERTGRwVu79xiAs%2Fj0aOGF%2Ffg%3D]

Response

ActivityClass.JSON

"scores":
\[{
"email":"BarneyRubble@scorestest.com",
"scoreName":"activityClass",
"score":"Engaged",
"comment":""
}
\]

TransactionFrequency.XML

<\!---->
\-
<scores>
<email>BarneyRubble@scorestest.com</email>
<scoreName>transactionFrequency</scoreName>
<score>Engaged</score>
</scores>

TransactionRecency.JSON

"scores":\[{
"email":"BarneyRubble@scorestest.com",
"scoreName":"transactionRecency",
"score":"Active",
"comment":""
}
\]

AverageSpentValue.JSON

<\!---->
<scores>
<email>BarneyRubble@scorestest.com</email>
<scoreName>averageSpentValue</scoreName>
<score>Very Low</score>
</scores>