API: Users
In this page
The User object
A user has several properties. Each API can return a User model in its entirety or with just a subset. All the properties are listed here:
Property | Type | Description |
---|---|---|
user_id |
Numeric | Unique user identifier |
fullname |
String | A user’s full name |
site_url |
String | Public URL of the user on Spreaker’s website |
image_original_url |
String | Original size image URL |
image_url |
String | 200x200px size image URL |
username |
String | User username |
description |
String | User biography |
kind |
String | It could be listener or producer |
plan |
String | It will be basic for a free account, or other values for a Pro account |
followers_count |
Numeric | The number of users following this user |
followings_count |
Numeric | The number of users that this user follows |
contact_email |
String | Contact email |
is_following_you |
Boolean | true if this user follows the requesting user, false otherwise |
you_are_following |
Boolean | true if the requesting user follows this user, false otherwise |
verified |
Boolean | true if this user has confirmed their email address or social connection, false otherwise |
birthday |
String | User birthday |
gender |
String | It could be male or female |
timezone |
String | The timezone that should be used to convert UTC timestamps, before it is displayed. The timezone value is auto-detected |
Many of the resources on the user APIs are related to a single user.
If a request URL includes USER-ID
it could be the numeric user_id
or username
.
Retrieving a Single User
You can retrieve the public information of a user profile by sending a GET
request to the URL above. This API will only return public user profile data, even if the request is authenticated with the requested USER-ID
token. To retrieve the full user profile, including private data, you should use the API GET /v2/me
.
Example
The response body is a JSON object containing all the public user profile fields.
Retrieving the Authenticated User
Authenticated: yes
You can retrieve all of a user’s profile data, including private information, by sending an authenticated GET
request to this API. It can only be used to retrieve the data of an authenticated user.
Example
Updating a User
Authenticated: yes. Owner: yes
The API POST /v2/users/USER-ID
supports these parameters, none of which are required, as you should specify only the ones you want to update:
Parameter | Type | Requirements |
---|---|---|
fullname |
String | Max length: 30 |
description |
String | - |
gender |
String | Allowed: MALE or FEMALE |
birthday |
String | A date string with the format YYYY-MM-DD |
show_age |
Boolean | - |
location |
String | - |
location_latitude |
Numeric | - |
location_longitude |
Numeric | - |
content_languages |
String | ISO 639-1 language code. Allowed: sq ar be bg cs zh hr da et fi fr ja el is lt it en mk no nl pl pt ro ru sr sk sl es sv de tr uk hu |
username |
String | Min length: 4. Max length: 30. Can only contain letters, numbers 0-9 and _-. . Must be unique. Can be changed only once |
contact_email |
String | - |
image_file |
File | At least 400x400, Max size: 5MB, Formats: JPG, PNG |
image_crop |
String | Comma-separated coordinates (top left X, top left Y, bottom right X, bottom right Y) are used to crop the image_file . If not specified, the image_file will not be cropped. This parameter is effective only if the request contains an image_file . |
Example
The response body is a JSON object containing all the user fields.
Retrieving a User’s Followers
The response body is a paginated list of Users.
Retrieving Who a User Follows
The response body is a paginated list of Users.
Following a User
Authenticated: yes
The USER-ID
user follows FOLLOWED-ID
. It requires the request to be authenticated with USER-ID
credentials.
Unfollowing a User
Authenticated: yes
The USER-ID
user unfollows FOLLOWED-ID
. It requires the request to be authenticated with USER-ID
credentials.
Retrieving a User’s Blocked Users List
Retrieve the list of users blocked by USER-ID
Authenticated: yes
The response body is a paginated list of Users.
Blocking a User
Authenticated: yes
The USER-ID
user will add a BLOCKED-ID
user in his own Blocked list.
It requires the request to be authenticated with USER-ID
credentials.
Unblocking a User
Authenticated: yes
The USER-ID
user will remove a BLOCKED-ID
user from his own Blocked list.
It requires the request to be authenticated with USER-ID
credentials.