Account users - Heyloyalty/api GitHub Wiki
Important! requires a reseller account.
When issuing calls to the Heyloyalty Partner API you will be able to manage your partner accounts, by creating, editing, deleting and viewing usage. You will also be able to manage user accessibility for your accounts, by creating, editing or deleting partner account users.
Endpoint: https://api.heyloyalty.com/reseller
Please see how to authenticate in the Getting started section.
- Get account users
- Get a single account user
- Create an account user
- Edit an account user
- Delete an account user
Gets all user by account id
GET /accounts/:id/users
This method takes no parameters
Get all users with account id 1
http://api.heyloyalty.com/reseller/accounts/1/users
Status 200 ok
[
{
"id": "1",
"is_admin": "1",
"is_shop": null,
"role_id": "1",
"name": "John",
"email": "[email protected]",
"system_language_id": "1",
"reference_id": "1",
"timezone_id": "326",
"created_at": "2014-01-01 00:00:00",
"updated_at": "2014-01-01 00:00:00"
}
]
Account doesn't exist
Status 404 account not found
Gets a user by account id and user id
GET /accounts/:id/users/:id
This method takes no parameters
Get a user with account id 1 and user id 1
http://api.heyloyalty.com/reseller/accounts/1/users/1
Status 200 ok
{
"id": "1",
"is_admin": "1",
"is_shop": null,
"role_id": "1",
"name": "John",
"email": "[email protected]",
"system_language_id": "1",
"reference_id": "1",
"timezone_id": "326",
"created_at": "2014-01-01 00:00:00",
"updated_at": "2014-01-01 00:00:00"
}
Account don't excist
Status 404 account not found
User not found
Status 404 user not found
Creates a new user on an account
POST /accounts/:id/users
Name | Description | Type | Required |
---|---|---|---|
name | name on the user | string | x |
email on the user | string | x | |
password | password on the user, minimum 8 characters | string | x |
Creates a user on account with id 1
http://api.heyloyalty.com/reseller/account/1/users/?name=john doe&[email protected]&password=cHx0f7BB&reference_id=SB-1232
On success returns the new user id
Status 200 ok
{ "id": 2 }
Account don't excist
Status 404 account not found
Missing fields
{
"name": [
"The name field is required."
],
"email": [
"The email field is required."
],
"password": [
"The password field is required."
]
}
Edits a user on an account
PUT /accounts/:id/users/:id
See create a user for parameters
Updates a user with account id 1 and user id 2
http://api.heyloyalty.com/reseller/accounts/1/users /2/?name=John Doe&[email protected]&password=hgyt9J36Hi&reference_id=SB-2332
Status 204 on content
Account don't excist
Status 404 account not found
User don't excist
Status 404 user not found
Missing fields
{
"name": [
"The name field is required."
],
"email": [
"The email field is required."
],
"password": [
"The password field is required."
]
}
Deletes a user on an account
DELETE /accounts/:id/users/:id
This method takes no parameters
Deletes a user on account with id 1 and user id 2
http://api.heyloyalty.com/reseller/accounts/1/users/1
Status 204 on content
Account don't excist
Status 404 account not found
User don't excist
Status 404 user not found