Accounts - Heyloyalty/api GitHub Wiki
Warning! requires reseller account. How to become a reseller
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.
Partner API URL: https://api.heyloyalty.com/reseller
- Get accounts
- Get a single account
- Get a single account usage
- Create an account
- Edit an account
- Delete an account
- Heypush feature on an account
Show accounts related to reseller id
GET /accounts
Method accepts no parameters
Gets all accounts related to a reseller id
https://api.heyloyalty.com/reseller/accounts
Status 200 ok
[
{
"id": "1",
"type": "active",
"name": "Loyalitets Bureauet",
"firstname": "John",
"lastname": "Doe",
"mobile": "88888888",
"phone": "88888888",
"address": "Jens Baggesensvej 47",
"address_2": null,
"zipcode": "8200",
"city": "Århus N",
"cvr_no": "1234567890",
"created_at": "2014-01-01 00:00:00",
}
]
No account
Status 404 not found
Gets information about a single account
GET /accounts/:id
This method takes no parameters.
Get account information from account with id of 1.
https://api.heyloyalty.com/reseller/accounts/1
Status 200 ok
{
"id": "1",
"type": "active",
"name": "Loyalitets Bureauet",
"firstname": "Loyalitets",
"lastname": "Bureauet",
"mobile": "88888888",
"phone": "88888888",
"address": "Jens Baggesensvej 47",
"address_2": null,
"zipcode": "8200",
"city": "Århus N",
"cvr_no": "1234567890",
"api_secret": "e9433d45eead594a721cf30adcf35d70",
"api_key": "5a0f2d5629afa615",
"notes": []
}
No account
Status 404 not found
Gets the accounts usage
GET /accounts/:id/usage
Name | Description | Type |
---|---|---|
from | YYYY-MM-DD H:I:S | datetime |
to | YYYY-MM-DD H:I:S | datetime |
Gets an account usage with id 1 and within a time range
https://api.heyloyalty.com/reseller/accounts/1/usage/?from=2014-01-01 00:00:00&to=2014-02-12 00:00:00
Status 200 ok
{
"campaign": {
"email": [],
"sms": []
},
"autoresponder": {
"email": [],
"sms": []
},
"sms_countries": []
}
Account doesn't exist
Status 404 account not found
Creates a new account
POST /accounts
Name | Description | Type | Required |
---|---|---|---|
name | account name | string | x |
firstname | account firname | string | |
lastname | account lastname | string | |
mobile | account mobile | int | |
phone | account phone | int | |
address | account address | string | |
address_2 | account address 2 | string | |
zipcode | account zipcode | string | |
city | account city | string | |
cvr_no | your company cvr number | int | |
type | active, demo, freemium or suspended | string | x |
Minimum parameters for creating an account.
https://api.heyloyalty/reseller/?name=myaccount
All parameters for creating an account.
https://api.heyloyalty.com/reseller/name=myaccount&firstname=my&lastname=account&mobile=00000000&phone=00000000&address=st sct Andrews 58&address_2=st road 41&zipcode=12000&city=mycity&cvr_no=123456789
The id of the new account is returned
Status 201 Created
{ id:1 }
Missing fields
{ "name": [ "The name field is required."] }
Updates an account with the specified parameters, parameters not specified will not be updated.
PUT /accounts/:id
See create an account for other parameters
Updates an account name
https://api.heyloyalty.com/reseller/accounts/1/?name=MyCompany
Suspend an account
https://api.heyloyalty.com/reseller/accounts/1/?name=MyCompany&type=suspended
Status 204 no content
Account don't excist
Status 404 account not found
Deletes an account
DELETE /accounts/:id
This method takes no parameters
Deletes an account with 1 as id.
https://api.heyloyalty.com/reseller/accounts/1
Status 204 no content
The method does not return anything on success
Account don't excist
Status 404 account not found
Does account have heypush / adds heypush / removes heypush
GET /accounts/:id/heypush
This method takes no parameters
Checks if an account with 1 as id has heypush.
https://api.heyloyalty.com/reseller/accounts/1/heypush
Status 200 ok
"Account has webpush"
Status 404 not found
"No webpush active on account"
POST /accounts/:id/heypush
This method takes no parameters
Adds heypush to an account with 1 as id.
https://api.heyloyalty.com/reseller/accounts/1/heypush
Status 200 ok
The method does not return anything on success
DELETE /accounts/:id/heypush
This method takes no parameters
Deletes heypush on an account with 1 as id.
https://api.heyloyalty.com/reseller/accounts/1/heypush
Status 200 ok
The method does not return anything on success