Profiling
The profiling system offers the necessary endpoints to feed the user's profile interests and measure how much they like/dislike a presented item.
Interests
Interest Types
These are the currently available interest types, but more will be added in the future. As for the interest values, users can input whatever value occurs to them; said value will then be homogenized and given a proper, global meaning.
ID | Type | Description |
---|---|---|
1 | general | General topics like "International", "Science", "Finance", etc. and more specific topics like "Barack Obama", "Rihanna", "China", etc. |
2 | sports | Sports, like "Tennis", "Golf", etc. |
3 | sport_teams | Specific sports teams, like "Athletic Club", "New York Giants", etc. |
4 | tv | TV program categories like "Movies", "Series", etc. or favorite TV channels and/or programs |
5 | movies | Movie genres, themes, or titles like "Action", "Drama", "Horror", etc. |
6 | food | Favorites type of food, restaurants, cuisine, like "Pizza", "Spanish", "Mexican", "Chinese", etc. |
7 | places | Countries, cities, etc. of interest |
8 | people | Celebrities, athletes, actors, etc. |
9 | companies | Companies of interest |
10 | music | Music genres, song titles, artists, etc. |
GET /profile/interest-types
Get the available interest types from the server, programatically.
Response
Code | Name |
---|---|
200 | OK |
401 | Unauthorized |
500 | Internal Server Error |
List of possible interest type values.
curl -X GET "https://api.sherpa.ai/v2/profile/interest-types" \
-H "Authorization: Basic XXXX-SHERPA-TOKEN-XXXX" \
-H "Accept-Language: es-ES" \
-H "Time-Zone: Europe/Madrid"
["general","sports","sports_teams","tv","movies","food","places","people","companies","music"]
List
GET /profile/interests
Fetch a user's interests.
Response
Code | Name |
---|---|
200 | OK |
401 | Unauthorized |
500 | Internal Server Error |
List of interest types, with a list of interests within each.
curl -X GET "https://api.sherpa.ai/v2/profile/interests" \
-H "Authorization: Basic XXXX-SHERPA-TOKEN-XXXX" \
-H "Accept-Language: es-ES" \
-H "Time-Zone: Europe/Madrid"
{
"general": ["science", "movies"],
"sports": ["tennis", "golf"],
"sport_teams": ["Athletic Club Bilbao", "FC Barcelona"]
}
GET /profile/interest-types/{type}/interests
Fetch a user's interests, filtered by type.
curl -X GET "https://api.sherpa.ai/v2/profile/interest-types/general/interests" \
-H "Authorization: Basic XXXX-SHERPA-TOKEN-XXXX" \
-H "Accept-Language: es-ES" \
-H "Time-Zone: Europe/Madrid"
{
"general": [
"science",
"movies",
"finance"
]
}
Parameters
Field | Source | Mandatory | Type | Description |
---|---|---|---|---|
type | Query | ✓ | String | Interest group. See Interest Types. |
Response
Code | Name |
---|---|
200 | OK |
401 | Unauthorized |
404 | Not Found |
500 | Internal Server Error |
List of interests for the requested type.
Add
POST /profile/interest-types/{type}/interests/{interest}
Add an interest item to the interest type.
curl -X POST "https://api.sherpa.ai/v2/profile/interest-types/general/interests/technology" \
-H "Authorization: Basic XXXX-SHERPA-TOKEN-XXXX" \
-H "content-type: application/json" \
-H "Accept-Language: es-ES" \
-H "Time-Zone: Europe/Madrid" \
Parameters
Field | Source | Mandatory | Type | Description |
---|---|---|---|---|
type | Query | ✓ | String | Interest group. See Interest Types. |
interest | Query | ✓ | String | Interest. |
Response
Code | Name |
---|---|
201 | Created |
400 | Bad Request |
401 | Unauthorized |
500 | Internal Server Error |
Delete
DELETE /profile/interest-types/{type}/interests/{interest}
Delete an interest item from the interest type.
curl -X DELETE "https://api.sherpa.ai/v2/profile/interest-types/general/interests/technology" \
-H "Authorization: Basic XXXX-SHERPA-TOKEN-XXXX" \
-H "content-type: application/json" \
-H "Accept-Language: es-ES" \
-H "Time-Zone: Europe/Madrid" \
Parameters
Field | Source | Mandatory | Type | Description |
---|---|---|---|---|
interest | Query | ✓ | String | Interest. |
type | Query | ✓ | String | Interest type. See Interest Types. |
Response
Code | Name |
---|---|
204 | No Content |
400 | Bad Request |
401 | Unauthorized |
500 | Internal Server Error |
Feedback
POST /profile/items/{id_sherpa}/like
POST /profile/items/{id_sherpa}/dislike
Register how much a user likes/dislikes an item.
curl -X POST "https://api.sherpa.ai/v2/profile/items/91f462ac-8fd4-44ea-8a5c-5d0aa62fa3c9/like" \
-H "Authorization: Basic XXXX-SHERPA-TOKEN-XXXX"
curl -X POST "https://api.sherpa.ai/v2/profile/items/91f462ac-8fd4-44ea-8a5c-5d0aa62fa3c9/dislike" \
-H "Authorization: Basic XXXX-SHERPA-TOKEN-XXXX"
Parameters
Field | Source | Mandatory | Type | Description |
---|---|---|---|---|
id_sherpa | Query | ✓ | String | ID of a previously returned item (response, data item, etc.) |
Response
Code | Name |
---|---|
204 | No Content |
400 | Bad Request |
401 | Unauthorized |
404 | Not Found |
500 | Internal Server Error |
DELETE /profile/items/{id_sherpa}/like
DELETE /profile/items/{id_sherpa}/dislike
Unregister how much a user likes/dislikes an item.
curl -X DELETE "https://api.sherpa.ai/v2/profile/items/91f462ac-8fd4-44ea-8a5c-5d0aa62fa3c9/like" \
-H "Authorization: Basic XXXX-SHERPA-TOKEN-XXXX"
curl -X DELETE "https://api.sherpa.ai/v2/profile/items/91f462ac-8fd4-44ea-8a5c-5d0aa62fa3c9/dislike" \
-H "Authorization: Basic XXXX-SHERPA-TOKEN-XXXX"
Parameters
Field | Source | Mandatory | Type | Description |
---|---|---|---|---|
id_sherpa | Query | ✓ | String | ID of a previously returned item (response, data item, etc.) |
Response
Code | Name |
---|---|
204 | No Content |
400 | Bad Request |
401 | Unauthorized |
404 | Not Found |
500 | Internal Server Error |