User API documentation version v1
https://client-api.{environment}/api/user/v1
- environment: required(one of magine.com, tvoli.com - default: magine.com)
User
Get or update a user. Users are only authorized to access themself.
Returns a user.
Updates the user properties that are included in the request body.
get /users/{userId}
Returns a user.
URI Parameters
- userId: required(string)
Example:
007T1RQUSR
Headers
- Magine-AccessToken: required(string)
A token that identifies a specific partner
Example:
25b70ae1-d2bd-4ae7-85f4-62026580c866
- Authorization: required(string)
Bearer {token}
Example:
Bearer 4b6fbf80...
HTTP status code 200
User was successfully updated.
Body
Media type: application/json
Type: object
Properties- userId: required(string)
- birthDate: (string)
- createdTimestamp: required(datetime)
- country: required(string)
- locale: required(string)
- name: (string)
- email: (string)
- gender: (string)
- mobilePhone: (string)
- tags: required(array of string)
- zipCode: (string)
Example:
{
"active": true,
"birthDate": "1980-01-21",
"codes": {},
"country": "SE",
"createdTimestamp": "2016-10-18T14:35:39.857Z",
"deleted": false,
"email": "contact@example.com",
"emailDoubleOptIn": false,
"emailOptIn": false,
"gender": "X",
"locale": "sv-SE",
"mobilePhone": "612345678",
"name": "Foo Bar",
"newsletters": [],
"openIds": {
"google": "https://www.google.com/profiles/115030379361822725917",
"magine": "login@example.com"
},
"smsLog": {},
"tags": [],
"trial": {
"active": false
},
"userId": "5B5J5QZ8XFAL4MMJZJDJUI4ALUSR",
"verified": true,
"zipCode": "12345"
}
HTTP status code 400
Bad request. The user id is invalid.
HTTP status code 401
Unauthorized request.
HTTP status code 404
The requested user does not exist.
put /users/{userId}
Updates the user properties that are included in the request body.
URI Parameters
- userId: required(string)
Example:
007T1RQUSR
Headers
- Magine-AccessToken: required(string)
A token that identifies a specific partner
Example:
25b70ae1-d2bd-4ae7-85f4-62026580c866
- Authorization: required(string)
Bearer {token}
Example:
Bearer 4b6fbf80...
Body
Media type: application/json
Type: object
Properties- birthDate: (string)
- country: (string)
- gender: (string)
- locale: (string)
- name: (string)
- email: (string)
- emailOptIn: (string)
- mobilePhone: (string)
- parentalControl: (string)
- parentalControlPinCode: (string)
- zipCode: (string)
Example:
name:
{
"birthDate": "1980-12-31",
"gender": "Female",
"name": "New name",
"zipCode": "12345"
}
HTTP status code 200
Success.
Body
Media type: application/json
Type: object
Properties- result: required(string)
Example:
{
"result": "updated"
}
HTTP status code 400
Bad request.
Body
Media type: application/json
Type: any
Examples:
forbidden:
{
"code": 400,
"errors": [
{
"field": "notAField",
"reason": "forbidden"
}
],
"message": "Bad request"
}
invalid:
{
"code": 400,
"errors": [
{
"field": "name",
"reason": "invalid"
}
],
"message": "Bad request"
}
HTTP status code 401
Unauthorized request.
Get or update dynamic user data
Get dynamic user data.
Update dynamic user data.
get /users/{userId}/dynamic
Get dynamic user data.
URI Parameters
- userId: required(string)
Example:
007T1RQUSR
Headers
- Magine-AccessToken: required(string)
A token that identifies a specific partner
Example:
25b70ae1-d2bd-4ae7-85f4-62026580c866
- Authorization: required(string)
Bearer {token}
Example:
Bearer 4b6fbf80...
put /users/{userId}/dynamic
Update dynamic user data.
URI Parameters
- userId: required(string)
Example:
007T1RQUSR
Headers
- Magine-AccessToken: required(string)
A token that identifies a specific partner
Example:
25b70ae1-d2bd-4ae7-85f4-62026580c866
- Authorization: required(string)
Bearer {token}
Example:
Bearer 4b6fbf80...
Get or update user tags
Get user tags
Add tags to a user
get /users/{userId}/tags
Get user tags
URI Parameters
- userId: required(string)
Example:
007T1RQUSR
Headers
- Magine-AccessToken: required(string)
A token that identifies a specific partner
Example:
25b70ae1-d2bd-4ae7-85f4-62026580c866
- Authorization: required(string)
Bearer {token}
Example:
Bearer 4b6fbf80...
post /users/{userId}/tags
Add tags to a user
URI Parameters
- userId: required(string)
Example:
007T1RQUSR
Headers
- Magine-AccessToken: required(string)
A token that identifies a specific partner
Example:
25b70ae1-d2bd-4ae7-85f4-62026580c866
- Authorization: required(string)
Bearer {token}
Example:
Bearer 4b6fbf80...
Body
Media type: application/json
Type: array of string
Example:
["one-tag", "another-tag"]
Remove a tag from a user
delete /users/{userId}/tags/{tag}
Remove a tag from a user
URI Parameters
- userId: required(string)
Example:
007T1RQUSR
- tag: required(string)
Headers
- Magine-AccessToken: required(string)
A token that identifies a specific partner
Example:
25b70ae1-d2bd-4ae7-85f4-62026580c866
- Authorization: required(string)
Bearer {token}
Example:
Bearer 4b6fbf80...