Account Management API (ENG)

Account Management API (ENG)

INTRODUCTION

The API is used to manage Icareus Suite users and organisations.

USE CASES

Adding sub organization 

API Calls flow to add sub organization:

  1. Create an organization 
  2. Add User
  3. Assign User 
  4. Assign User role

API PATH

/delegate/account

API METHODS

CREATE AN ORGANIZATION

REQUEST

This request will create a new organization. The parameter with name 'token' is used to verify the request. The 'action' parameter with value 'addOrganization' should be used to identify that this is add organization request.

Parameters:

Name
Value
Requirement
Info
action
'addOrganization'
Identifies the request type 
Mandatory
organizationId
number
The parent organization ID 
Mandatory
accountType
string
'full-organization' 
Mandatory
name
string
Organization name 
Mandatory
countryId
number
Organization country ID 
Mandatory
regionId
number
Organization region ID 
Mandatory
postalCode
string
Organization postal code
Mandatory
cityName
string
Organization city name
Mandatory
phoneNumber
string
Organization phone number
Mandatory
emailAddress
string
Organization e-mail
Mandatory
edition
string
 "ismaccount"
Mandatory
templateIdnumberPlease contact Icareus support to get your templateIdMandatory
token
string
 
Mandatory

A token consists of 42 character long hex value. The value has three different parts:

  • Version [8 bits / 2 chars] - current version
  • Current time [32 bits / 8 chars] - current timestamp in number of seconds since 1970 UTC
  • Signature [128 bits / 32 chars] - the MD5 hash of (organizationId + ":" + accountType + ":" + name + ":" + countryId + ":" + regionId + ":" + postalCode + ":" + cityName + ":" + phoneNumber + ":" + emailAddress + ":" Current time ++ ”:” ++ Key), where ’’ is a string concatenation

Key - A secret key that is only present on the client creating the token and the server verifying the token and is defined for the organization.

Required parameter for creating token are 

  1. organizationId (string): The ID of the organization.
  2. accountType (string): The type of the account.
  3. name (string): The name of the sub-organization.
  4. countryId (string): The ID of the country where the sub-organization is located.
  5. regionId (string): The ID of the region where the sub-organization is located.
  6. postalCode (string): The postal code of the sub-organization's address.
  7. cityName (string): The name of the city where the sub-organization is located.
  8. phoneNumber (string): The contact phone number of the sub-organization.
  9. emailAddress (string): The contact email address of the sub-organization.
  10. secret (string): The secret used for signature generation.
Attached below is a JS Function on how to create this token 

  1. import crypto from 'crypto';

  2. export const createSubOrgToken = (
  3. organizationId,
  4. accountType,
  5. name,
  6. countryId,
  7. regionId,
  8. postalCode,
  9. cityName,
  10. phoneNumber,
  11. emailAddress,
  12. secret
  13. ) => {
  14. const currentTimeStr = getCurrentTime();
  15.         const  arg = "" + organizationId + ":" + accountType + ":" + name + ":" + countryId + ":" + regionId + ":" + postalCode + ":" + cityName + ":" + phoneNumber + ":" + emailAddress + ":" + currentTimeStr + ":" + secret;
  16.         const signature = crypto.createHash("md5").update(arg).digest("hex");
  17. return  "02" + currentTimeStr + signature;
  18.  
  19. };

  20. export const getCurrentTime = () => {
  21. return Math.floor(new Date().getTime() / 1000).toString(16);
  22. };

Example cURL request

  1. curl --location 'https://my.icareus.com/delegate/account?action=addOrganization&organizationId=4692809&accountType=full-organization&name=test%20organization&countryId=88&regionId=1&postalCode=01400&cityName=Helsinki&phoneNumber=0444457678&emailAddress=test-organization%40icareus.com&token=0262ebb9ee5f0d447beeacb2bc6dcba6e7369c6015&edition=ismaccount&templateId=1'

Example URL request 

  1. https://my.icareus.com/delegate/account?action=addOrganization&organizationId=4692809&accountType=full-organization&name=test%20organization&countryId=88&regionId=1&postalCode=01400&cityName=Helsinki&phoneNumber=0444457678&emailAddress=test-organization@icareus.com&token=0262ebb9ee5f0d447beeacb2bc6dcba6e7369c6015&edition=ismaccount&templateId=1

RESPONSE

The new organization ID and it's secret key will be returned back in the JSON form:

{"status":"ok","organizationId":"12345","key":"aSaqw2W"}

In case of failure the error message will be returned back in the JSON form:

 


Add admin user and assign role

All 3 API calls need to be made to add an user to a newly created organization

  1. Add User
  2. Assign User (to organization)
  3. Assign User role 

API PATH

/delegate/account

API METHODS

ADD USER

REQUEST

This request will create a new user. The parameter with name 'token' is used to verify the request. The 'action' parameter with value 'addUser' should be used to identify that this is add user request.

Parameters:

Name
Value
Requirement
Info
action
'addUser'
Identifies the request type 
Mandatory
organizationId
number
Organization Id received from "addOrganization" response API callMandatory
password
string
Password of user
Mandatory
firstName
string
User first name 
Mandatory
lastName
string
User last name 
Mandatory
screenName
string
User screen name
Optional
countryId
number
User country ID 
Mandatory
regionId
number
User region ID 
Mandatory
postalCode
string
User postal code
Mandatory
cityName
string
User city name
Mandatory
phoneNumber
string
User phone number
Mandatory
emailAddress
string
User e-mail 
Mandatory
languageId
string
language ID for the user 
Optional
Example: (en_US, en_GB, fi_FI, es_ES ...)
comments
string
Some comnents about that user 
Optional
token
string
 
Mandatory

A token consists of 42 character long hex value. The value has two different parts:

  • Version [8 bits / 2 chars] - current version
  • Current time [32 bits / 8 chars] - current timestamp in number of seconds since 1970 UTC
  • Signature [128 bits / 32 chars] - the MD5 hash of (organizationId + ":" + firstName + ":" + lastName + ":" + screenName + ":" + countryId + ":" + regionId + ":" + postalCode + ":" + cityName + ":" + phoneNumber + ":" + emailAddress + ":" + Current time + ”:” + Key ), where ’+’ is a string concatenation

Note: screenName must be included in signature generation if it is provided as a parameter

Key - A secret key that is only present on the client creating the token and the server verifying the token and is defined for the organization.

Example:
Version = 1 -> ”01”
organizationId = ”14806”
firstName = ”a”
lastName = ”a”
screenName = ”c” (If provided)
countryId = ”1”
regionId = ”1”
postalCode = ”a”
cityName = ”a”
phoneNumber = ”1”
emailAddress = ”b@icareus.com
Current time = 1222516160 (Sat Sep 27 13:49:20 CEST 2008) -> ”48de1dc0”
Key = ”secret”
Signature = MD5("14806:a:a:c:1:1:a:a:1:b@icareus.com:48de1dc0:secret") -> ”7b011f04a63b03f32bcf9d9568784036”

Then token would be "0148de1dc07b011f04a63b03f32bcf9d9568784036".

http://192.168.1.229/delegate/account?action=addUser&organizationId=14806&firstName=a&lastName=a&screenName=c&countryId=1&regionId=1&postalCode=a&cityName=a&phoneNumber=1&emailAddress=b@icareus.com&token=0148de1dc07b011f04a63b03f32bcf9d9568784036

RESPONSE

The new user ID  will be returned back in the JSON form:

{"status":"ok","userId":"12345"}

In case of failure the error message will be returned back in the JSON form:

{"status":"error","message":"Incorrect parameters"}

  ASSIGN USER

This request will add a user to an organization. The parameter with name 'token' is used to verify the request. The 'action' parameter with value 'assignUser' should be used to identify that this is assign user request.

REQUEST

Parameters:

Name
Value
Requirement
Info
action
'assignUser'
Identifies the request type 
Mandatory
organizationId
number
Organization Id received from "addOrganization" response
Mandatory
userId
number
userId received from "addUser" responseMandatory
token
string
 
Mandatory

A token consists of 42 character long hex value. The value has three different parts:

  • Version [8 bits / 2 chars] - current version
  • Current time [32 bits / 8 chars] - current timestamp in number of seconds since 1970 UTC
  • Signature [128 bits / 32 chars] - the MD5 hash of (organizationId + ”:” + userId + ”:” Current time + ”:” + Key), where ’+’ is a string concatenation

Key - A secret key that is only present on the client creating the token and the server verifying the token and is defined for the organization.

Example:
Version = 1 -> ”01”
organizationId = 14888
userId = 14861
Current time = 1222516160 (Sat Sep 27 13:49:20 CEST 2008) -> ”48de1dc0”
Key = ”LdVkNSw4eT”
Signature = MD5("14888:14861:48de1dc0:secret") -> ”8e0343669bd45f887908a4c7afdf67c3”

Then token would be "0148de1dc08e0343669bd45f887908a4c7afdf67c3".

http://192.168.1.229/delegate/account?action=assignUser&organizationId=14888&userId=14861&token=0148de1dc08e0343669bd45f887908a4c7afdf67c3

RESPONSE

The status of the operation will be returned back in the JSON form:

{"status":"ok"}

In case of failure the error message will be returned back in the JSON form:

{"status":"error","message":"Incorrect parameters"}

ASSIGN USER ROLE

This request will add a user role to the specified user. The parameter with name 'token' is used to veryfy the request. The 'action' parameter with value 'assignUser' should be used to identify that this is assign user request.

REQUEST

Parameters:

Name
Value
Requirement
Info
action
'assignUserRole'
Identifies the request type 
Mandatory
organizationId
number
Organization Id received from "addOrganization" response
Mandatory
userId
number
userId received from "addUser" responseMandatory
role
string
"admin"
Mandatory
token
string
 
Mandatory

A token consists of 42 character long hex value. The value has three different parts:

  • Version [8 bits / 2 chars] - current version
  • Current time [32 bits / 8 chars] - current timestamp in number of seconds since 1970 UTC
  • Signature [128 bits / 32 chars] - the MD5 hash of (organizationId + ”:” + userId + ”:” role + ”:” Current time + ”:” + Key), where ’+’ is a string concatenation

Key - A secret key that is only present on the client creating the token and the server verifying the token and is defined for the organization.

Example:
Version = 1 -> ”01”
organizationId = 14888
userId = 14861
role = admin
Current time = 1222516160 (Sat Sep 27 13:49:20 CEST 2008) -> ”48de1dc0”
Key = ”LdVkNSw4eT”
Signature = MD5("14888:14861:admin:48de1dc0:secret") -> ”8e0343669bd45f887908a4c7afdf67c3”

Then token would be "0148de1dc08e0343669bd45f887908a4c7afdf67c3".

http://192.168.1.229/delegate/account?action=assignUser&organizationId=14888&userId=14861&role=admin&token=0148de1dc08e0343669bd45f887908a4c7afdf67c3

RESPONSE

The status of the operation will be returned back in the JSON form:

{"status":"ok"}

In case of failure the error message will be returned back in the JSON form:

{"status":"error","message":"Incorrect parameters"}







USE CASES

ADDING SUBSCRIBERS

API Calls flow to add Subscribers:

  1. Add User
  2. Assign User (to organization)
  3. Assign User role (role=user)

API PATH

/delegate/account

API METHODS

ADD USER

REQUEST

This request will create a new user. The parameter with name 'token' is used to veryfy the request. The 'action' parameter with value 'addUser' should be used to identify that this is add user request.

Parameters:

Name
Value
Requirement
Info
action
'addUser'
Identifies the request type 
Mandatory
organizationId
number
The organization ID for the secret key 
Mandatory
password
string
Password of user
Mandatory
firstName
string
User first name 
Mandatory
lastName
string
User last name 
Mandatory
screenName
string
User screen name
Optional
countryId
number
User country ID 
Mandatory
regionId
number
User region ID 
Mandatory
postalCode
string
User postal code
Mandatory
cityName
string
User city name
Mandatory
phoneNumber
string
User phone number
Mandatory
emailAddress
string
User e-mail 
Mandatory
languageId
string
language ID for the user 
Optional
Example: (en_US, en_GB, fi_FI, es_ES ...)
comments
string
Some comnents about that user 
Optional
token
string
 
Mandatory

A token consists of 42 character long hex value. The value has two different parts:

  • Version [8 bits / 2 chars] - current version
  • Current time [32 bits / 8 chars] - current timestamp in number of seconds since 1970 UTC
  • Signature [128 bits / 32 chars] - the MD5 hash of (organizationId + ":" + firstName + ":" + lastName + ":" + screenName + ":" + countryId + ":" + regionId + ":" + postalCode + ":" + cityName + ":" + phoneNumber + ":" + emailAddress + ":" + Current time + ”:” + Key ), where ’+’ is a string concatenation

Note: screenName must be included in signature generation if it is provided as a parameter

Key - A secret key that is only present on the client creating the token and the server verifying the token and is defined for the organization.

Example:
Version = 1 -> ”01”
organizationId = ”14806”
firstName = ”a”
lastName = ”a”
screenName = ”c” (If provided)
countryId = ”1”
regionId = ”1”
postalCode = ”a”
cityName = ”a”
phoneNumber = ”1”
emailAddress = ”b@icareus.com
Current time = 1222516160 (Sat Sep 27 13:49:20 CEST 2008) -> ”48de1dc0”
Key = ”secret”
Signature = MD5("14806:a:a:c:1:1:a:a:1:b@icareus.com:48de1dc0:secret") -> ”7b011f04a63b03f32bcf9d9568784036”

Then token would be "0148de1dc07b011f04a63b03f32bcf9d9568784036".

http://192.168.1.229/delegate/account?action=addUser&organizationId=14806&firstName=a&lastName=a&screenName=c&countryId=1&regionId=1&postalCode=a&cityName=a&phoneNumber=1&emailAddress=b@icareus.com&token=0148de1dc07b011f04a63b03f32bcf9d9568784036

RESPONSE

The new user ID and his password will be returned back in the JSON form:

{"status":"ok","userId":"12345"}

In case of failure the error message will be returned back in the JSON form:

{"status":"error","message":"Incorrect parameters"}

UPDATE USER

This request will update an existing user. The parameter with name 'token' is used to veryfy the request. The 'action' parameter with value 'updateUser' should be used to identify that this is update user request.

REQUEST

Parameters:

Name
Value
Requirement
Info
action
'updateUser'
Identifies the request type 
Mandatory
organizationId
number
The organization ID for the secret key 
Mandatory
userId
number
Identifies the user to update 
Mandatory
firstName
string
User first name 
Mandatory
lastName
string
User last name 
Mandatory
countryId
number
User country ID 
Mandatory
regionId
number
User region ID 
Mandatory
postalCode
string
User postal code
Mandatory
cityName
string
User city name
Mandatory
phoneNumber
string
User phone number
Mandatory
emailAddress 
string 
User email address 
Optional 
comments
string
Some coments for about that user 
Optional
token
string
 
Mandatory

A token consists of 42 character long hex value. The value has two different parts:

  • Version [8 bits / 2 chars] - current version
  • Current time [32 bits / 8 chars] - current timestamp in number of seconds since 1970 UTC
  • Signature [128 bits / 32 chars] - the MD5 hash of (organizationId + ":" + userId + ":" + firstName + ":" + ":" + lastName + ":" + countryId + ":" + regionId + ":" + postalCode + ":" + cityName + ":" + phoneNumber + ":" + Current time + ”:” + Key), where ’+’ is a string concatenation

Key - A secret key that is only present on the client creating the token and the server verifying the token and is defined for the organization.

Example:
Version = 1 -> ”01”
organizationId = ”14806”
userId = "9876"
firstName = ”a”
lastName = ”a”
countryId = ”1”
regionId = ”1”
postalCode = ”a”
cityName = ”a”
phoneNumber = ”1”
Current time = 1222516160 (Sat Sep 27 13:49:20 CEST 2008) -> ”48de1dc0”
Key = ”secret”
Signature = MD5("14806:9876:a:a:1:1:a:a:1:48de1dc0:secret") -> ”895a8f4ca9cbf09c315696e44483bd01”

Then token would be "0148de1dc0895a8f4ca9cbf09c315696e44483bd01".

http://192.168.1.229/delegate/account?action=updateUser&organizationId=14806&firstName=a&lastName=a&countryId=1&regionId=1&postalCode=a&cityName=a&phoneNumber=1&token=0148de1dc0895a8f4ca9cbf09c315696e44483bd01

RESPONSE

The action result will be returned back in the JSON form:

{"status":"ok"}

In case of failure the error message will be returned back in the JSON form:

{"status":"error","message":"Incorrect parameters"}

 


ASSIGN USER

This request will add a user to an organization. The parameter with name 'token' is used to veryfy the request. The 'action' parameter with value 'assignUser' should be used to identify that this is assign user request.

REQUEST

Parameters:

Name
Value
Requirement
Info
action
'assignUser'
Identifies the request type 
Mandatory
organizationId
number
The organization ID 
Mandatory
userId
number
The user ID to assign 
Mandatory
token
string
 
Mandatory

A token consists of 42 character long hex value. The value has three different parts:

  • Version [8 bits / 2 chars] - current version
  • Current time [32 bits / 8 chars] - current timestamp in number of seconds since 1970 UTC
  • Signature [128 bits / 32 chars] - the MD5 hash of (organizationId + ”:” + userId + ”:” Current time + ”:” + Key), where ’+’ is a string concatenation

Key - A secret key that is only present on the client creating the token and the server verifying the token and is defined for the organization.

Example:
Version = 1 -> ”01”
organizationId = 14888
userId = 14861
Current time = 1222516160 (Sat Sep 27 13:49:20 CEST 2008) -> ”48de1dc0”
Key = ”LdVkNSw4eT”
Signature = MD5("14888:14861:48de1dc0:secret") -> ”8e0343669bd45f887908a4c7afdf67c3”

Then token would be "0148de1dc08e0343669bd45f887908a4c7afdf67c3".

http://192.168.1.229/delegate/account?action=assignUser&organizationId=14888&userId=14861&token=0148de1dc08e0343669bd45f887908a4c7afdf67c3

RESPONSE

The status of the operation will be returned back in the JSON form:

{"status":"ok"}

In case of failure the error message will be returned back in the JSON form:

{"status":"error","message":"Incorrect parameters"}

ASSIGN USER ROLE

This request will add a user role to the specified user. The parameter with name 'token' is used to veryfy the request. The 'action' parameter with value 'assignUser' should be used to identify that this is assign user request.

REQUEST

Parameters:

Name
Value
Requirement
Info
action
'assignUserRole'
Identifies the request type 
Mandatory
organizationId
number
The organization ID 
Mandatory
userId
number
The user ID to assign 
Mandatory
role
string
The role to assign ("user","account-user", or "admin") 
Mandatory
token
string
 
Mandatory

A token consists of 42 character long hex value. The value has three different parts:

  • Version [8 bits / 2 chars] - current version
  • Current time [32 bits / 8 chars] - current timestamp in number of seconds since 1970 UTC
  • Signature [128 bits / 32 chars] - the MD5 hash of (organizationId + ”:” + userId + ”:” role + ”:” Current time + ”:” + Key), where ’+’ is a string concatenation

Key - A secret key that is only present on the client creating the token and the server verifying the token and is defined for the organization.

Example:
Version = 1 -> ”01”
organizationId = 14888
userId = 14861
role = admin
Current time = 1222516160 (Sat Sep 27 13:49:20 CEST 2008) -> ”48de1dc0”
Key = ”LdVkNSw4eT”
Signature = MD5("14888:14861:admin:48de1dc0:secret") -> ”8e0343669bd45f887908a4c7afdf67c3”

Then token would be "0148de1dc08e0343669bd45f887908a4c7afdf67c3".

http://192.168.1.229/delegate/account?action=assignUser&organizationId=14888&userId=14861&role=admin&token=0148de1dc08e0343669bd45f887908a4c7afdf67c3

RESPONSE

The status of the operation will be returned back in the JSON form:

{"status":"ok"}

In case of failure the error message will be returned back in the JSON form:

{"status":"error","message":"Incorrect parameters"}

REMOVE USER

This request will remove existing user. The parameter with name 'token' is used to verify the request. The 'action' parameter with value 'removeUser' should be used to identify that this is remove user request.

REQUEST

Parameters:

Name
Value
Requirement
Info
action
'removeUser'
Identifies the request type 
Mandatory
organizationId
number
The organization ID for the secret key 
Mandatory
userId
number
The user ID to remove 
Mandatory
token
string
 
Mandatory

A token consists of 42 character long hex value. The value has two different parts:

  • Version [8 bits / 2 chars] - current version
  • Current time [32 bits / 8 chars] - current timestamp in number of seconds since 1970 UTC
  • Signature [128 bits / 32 chars] - the MD5 hash of (organizationId + ":" + userId + ":" + Current time + ”:” + Key), where ’+’ is a string concatenation

Key - A secret key that is only present on the client creating the token and the server verifying the token and is defined for the organization.

Example:
Version = 1 -> ”01”
organizationId = ”14888”
userId = ”14861”
Current time = 1222516160 (Sat Sep 27 13:49:20 CEST 2008) -> ”48de1dc0”
Key = ”LdVkNSw4eT”
Signature = MD5("14888:14861:48de1dc0:secret") -> ”8e0343669bd45f887908a4c7afdf67c3”

Then token would be "0148de1dc08e0343669bd45f887908a4c7afdf67c3".

http://192.168.1.229/delegate/account?action=removeUser&organizationId=14888&userId=14861&token=0148de1dc08e0343669bd45f887908a4c7afdf67c3

RESPONSE

The status of the operation will be returned back in the JSON form:

{"status":"ok"}

In case of failure the error message will be returned back in the JSON form:

{"status":"error","message":"Incorrect parameters"}

REMOVE ORGANIZATION

This request will remove existing organization. The parameter with name 'token' is used to veryfy the request. The 'action' parameter with value 'removeOrganization' should be used to identify that this is remove organization request.

REQUEST

Parameters:

Name
Value
Requirement
Info
action
'removeOrganization'
Identifies the request type 
Mandatory
organizationId
number
The organization ID to remove 
Mandatory
token
string
 
Mandatory

A token consists of 42 character long hex value. The value has two different parts:

  • Version [8 bits / 2 chars] - current version
  • Current time [32 bits / 8 chars] - current timestamp in number of seconds since 1970 UTC
  • Signature [128 bits / 32 chars] - the MD5 hash of (organizationId + ":" + Current time + ”:” + Key), where ’+’ is a string concatenation

Key - A secret key that is only present on the client creating the token and the server verifying the token and is defined for the organization.

Example:
Version = 1 -> ”01”
organizationId = ”14888”
Current time = 1222516160 (Sat Sep 27 13:49:20 CEST 2008) -> ”48de1dc0”
Key = ”LdVkNSw4eT”
Signature = MD5("14888:48de1dc0:secret") -> ”5132005a6c7d59a93295ae119c76316b”

Then token would be "0148de1dc05132005a6c7d59a93295ae119c76316b".

http://192.168.1.229/delegate/account?action=removeOrganization&organizationId=14888&token=0148de1dc05132005a6c7d59a93295ae119c76316b

RESPONSE

The status of the operation will be returned back in the JSON form:

{"status":"ok"}

In case of failure the error message will be returned back in the JSON form:

{"status":"error","message":"Incorrect parameters"}

CHANGE PASSWORD

This request will change password for a particular user. The parameter with name 'token' is used to veryfy the request. The 'action' parameter with value 'changePassword' should be used to identify that this is change password request.

REQUEST

Parameters:

Name
Value
Requirement
Info
action
'changePassword'
Identifies the request type 
Mandatory
userId
number
The user ID 
Mandatory
organizationId
number
The organization ID that the user belongs to 
Mandatory
token
string
 
Mandatory
newPassword
string
 
Mandatory
confirmPassword
string
 
Mandatory

A token consists of 42 character long hex value. The value has two different parts:

  • Version [8 bits / 2 chars] - current version
  • Current time [32 bits / 8 chars] - current timestamp in number of seconds since 1970 UTC
  • Signature [128 bits / 32 chars] - the MD5 hash of (organizationId + ":" + userId + ":" + newPassword + ":" + confirmPassword + ":" + Current time + ”:” + Key), where ’+’ is a string concatenation

Key - A secret key that is only present on the client creating the token and the server verifying the token and is defined for the organization.

Example:
Version = 1 -> ”01”
organizationId = ”14888”
userId = ”12345”
newPassword = ”q1w2e3”
confirmPassword = ”q1w2e3”
Current time = 1222516160 (Sat Sep 27 13:49:20 CEST 2008) -> ”48de1dc0”
Key = ”LdVkNSw4eT”
Signature = MD5("14888:12345:q1w2e3:q1w2e3:48de1dc0:secret") -> ”5132005a6c7d59a93295ae119c76316b”

Then token would be "0148de1dc05132005a6c7d59a93295ae119c76316b".

http://192.168.1.229/delegate/account?action=changePassword&organizationId=14888&userId=12345&newPassword=q1w2e3&confirmPassword=q1w2e3&token=0148de1dc05132005a6c7d59a93295ae119c76316b

RESPONSE

The status of the operation will be returned back in the JSON form:

{"status":"ok"}

In case of failure the error message will be returned back in the JSON form:

{"status":"error","message":"Incorrect parameters"}

ACTIVATE PRODUCT

This request activates product with given product id for a particular user.

REQUEST

Parameters:

Name
Value
Requirement
Info
action
'activateProduct'
Activates the product identified by its product id 
Mandatory
userId
number
The user ID 
Mandatory
productId
number
The product ID 
Mandatory
organizationId
number
The organization ID that the user belongs to 
Mandatory
validUntil
number
Product validity in ms. 
validUntil = 0 . Product will be valid till 2050
validUntil = timestamp(ms) . Product valid until timestamp specified
No validUntil parameter - Product will be valid until default charging period  
Optional
token
string
 
Mandatory

A token consists of 42 character long hex value. The value has two different parts:

  • Version [8 bits / 2 chars] - current version
  • Current time [32 bits / 8 chars] - current timestamp in number of seconds since 1970 UTC
  • Signature [128 bits / 32 chars] - the MD5 hash of (organizationId + ":" + userId + ":" + productId +  ":" + validUntil+ ":" + Current time + ”:” + Key), where ’+’ is a string concatenation

Key - A secret key that is only present on the client creating the token and the server verifying the token and is defined for the organization.

Example:
Version = 1 -> ”01”
organizationId = ”13509”
userId = ”78121”
productId = ”37542” 

validUntil="1455275911724"

Current time = 1222516160 (Sat Sep 27 13:49:20 CEST 2008) -> ”48de1dc0”
Key = ”YJZsWc2VyU”

Signature = MD5("13509:78121:37542:1455275911724:48de1dc0:YJZsWc2VyU") -> ”cf9edae25a6ce47d474d8d5c2309d350”

Then token would be "0148de1dc0cf9edae25a6ce47d474d8d5c2309d350".

http://192.168.1.229/delegate/account?action=activateProduct&organizationId=13509&userId=78121&productId=37542&token=0148de1dc0cf9edae25a6ce47d474d8d5c2309d350&validUntil=1455275911724

RESPONSE

The status of the operation will be returned back in the JSON form:

{"message":"ProductId 37542 activated for userId 78121 till Fri Feb 12 11:18:31 GMT 2016", "ShoppingBuyerProductId":79439,"status":"ok"}

In case of failure the error message will be returned back in the JSON form:

{"status":"error","message":"Incorrect parameters"}

CANCEL PRODUCT

This request cancel product with given product id for a particular user.

REQUEST

Parameters:

Name
Value
Requirement
Info
action
'cancelProduct'
Cancel the product identified by its product id 
Mandatory
userId
number
The user ID 
Mandatory
productId
number
The shopping buyer product ID 
Mandatory
organizationId
number
The organization ID that the user belongs to 
Mandatory
token
string
 
Mandatory

A token consists of 42 character long hex value. The value has two different parts:

  • Version [8 bits / 2 chars] - current version
  • Current time [32 bits / 8 chars] - current timestamp in number of seconds since 1970 UTC
  • Signature [128 bits / 32 chars] - the MD5 hash of (organizationId + ":" + userId + ":" + productId +  ":" + Current time + ”:” + Key), where ’+’ is a string concatenation

Key - A secret key that is only present on the client creating the token and the server verifying the token and is defined for the organization.

Example:
Version = 1 -> ”01”
organizationId = ”13509”
userId = ”78121”
productId = ”79439”

Current time = 1222516160 (Sat Sep 27 13:49:20 CEST 2008) -> ”48de1dc0”

Key = ”YJZsWc2VyU”

Signature = MD5("13509:78121:79439:48de1dc0:YJZsWc2VyU") -> ”e6cf3674b58b85e55c05d3d7bba3477d”

Then token would be "0148de1dc0e6cf3674b58b85e55c05d3d7bba3477d".

http://192.168.1.229/delegate/account?action=cancelProduct&organizationId=13509&userId=78121&productId=79439&token=0148de1dc0e6cf3674b58b85e55c05d3d7bba3477d

RESPONSE

The status of the operation will be returned back in the JSON form:

{"message":"ShoppingBuyerProduct id 79439 cancelled","status":"ok"}

In case of failure the error message will be returned back in the JSON form:

{"status":"error","message":"Incorrect parameters"}

ADD DEVICE USER

This request adds user to a particular device.

REQUEST

Parameters:

Name
Value
Requirement
Info
action
'addDeviceUser'
Adds user to a particular device 
Mandatory
userId
number
The user ID 
Mandatory
udid
number
The device UDID
Mandatory
organizationId
number
The organization ID that the user belongs to 
Mandatory
token
string
 
Mandatory

A token consists of 42 character long hex value. The value has two different parts:

  • Version [8 bits / 2 chars] - current version
  • Current time [32 bits / 8 chars] - current timestamp in number of seconds since 1970 UTC
  • Signature [128 bits / 32 chars] - the MD5 hash of (organizationId + ":" + userId + ":" + idid  + ":" + Current time + ”:” + Key), where ’+’ is a string concatenation

Key - A secret key that is only present on the client creating the token and the server verifying the token and is defined for the organization.

Example:
Version = 1 -> ”01”
organizationId = ”13509”
userId = ”78121”
udid = ”3721421918681972”
Current time = 1222516160 (Sat Sep 27 13:49:20 CEST 2008) -> ”48de1dc0”
Key = ”YJZsWc2VyU”
Signature = MD5("13509:78121: 3721421918681972:48de1dc0:YJZsWc2VyU") -> ”fe91d0d1f737dd02d81d789c4cf6167e”

Then token would be "0148de1dc0fe91d0d1f737dd02d81d789c4cf6167e".

http://192.168.1.229/delegate/account?action=addDeviceUser&userId=78121&udid=3721421918681972&organizationId=13509&token=0148de1dc0fe91d0d1f737dd02d81d789c4cf6167e

RESPONSE

The status of the operation will be returned back in the JSON form:

{"message":"Device udid 3721421918681972 updated with user id 78121","status":"ok"}

In case of failure the error message will be returned back in the JSON form:

{"status":"error","message":"Incorrect parameters"}

REMOVE DEVICE USER

This request removes user associated with a particular device.

REQUEST

Parameters:

Name
Value
Requirement
Info
action
'removeDeviceUser'
Removes removes associated with a particular device 
Mandatory
userId
number
The user ID 
Mandatory
udid
number
The device UDID  
Mandatory
organizationId
number
The organization ID that the user belongs to 
Mandatory
token
string
 
Mandatory

A token consists of 42 character long hex value. The value has two different parts:

  • Version [8 bits / 2 chars] - current version
  • Current time [32 bits / 8 chars] - current timestamp in number of seconds since 1970 UTC
  • Signature [128 bits / 32 chars] - the MD5 hash of (organizationId + ":" + userId + ":" + udid  + ":" + Current time + ”:” + Key), where ’+’ is a string concatenation

Key - A secret key that is only present on the client creating the token and the server verifying the token and is defined for the organization.

Example:
Version = 1 -> ”01”
organizationId = ”13509”
userId = ”78121”
udid = ”3721421918681972”
Current time = 1222516160 (Sat Sep 27 13:49:20 CEST 2008) -> ”48de1dc0”
Key = ”YJZsWc2VyU”
Signature = MD5("13509:78121: 3721421918681972:48de1dc0:YJZsWc2VyU") -> ”fe91d0d1f737dd02d81d789c4cf6167e”

Then token would be "0148de1dc0fe91d0d1f737dd02d81d789c4cf6167e".

http://54.228.183.69/delegate/account?action=removeDeviceUser&userId=78121&udid=3721421918681972&organizationId=13509&token=0148de1dc0fe91d0d1f737dd02d81d789c4cf6167e

RESPONSE

The status of the operation will be returned back in the JSON form:

{"message":"Removed user from device udid 3721421918681972","status":"ok"}

In case of failure the error message will be returned back in the JSON form:

{"status":"error","message":"Incorrect parameters"}



















    • Related Articles

    • Event Management API (ENG)

      Event Management API Introduction This API is used to manage Events, and Event Participants. It can be used to create, edit, delete and list Events and Participants. TOKEN All request made to the following API endpoints require a token. The token ...
    • Publishing API (ENG)

      INTRODUCTION This API is used to query for media assets that are published. The API includes various calls for getting data for published assets in your account. API PATH /api/publishing/ API: VERSION 05 GET ASSETS REQUEST ...
    • Archive API (ENG)

      INTRODUCTION This API is used to manage the content within the Archive, actions like add asset, edit asset and delete asset. All calls must be made by supplying the unique token for your organization. API PATH /api/archive API CALLS ADD ASSET V.2 ...
    • Tilinhallinta (Account Management) API (FI)

      Icareus Suite Videopilvi integraatiot Johdanto Tätä API-rajapintoja voidaan käyttää Icareus Suite -alustalle tallennetun sisällön hallintaan ja kyselyihin. Kaikki API-kutsut palauttavat tiedot JSON-muodossa. TILIEN HALLINTA API Johdanto APIa ...
    • Channels Management API

      Introduction This API is used to manage Linear Channels. Authorization All requests made to the following API endpoints require a token. The token should be provided in the headers as: Authorization: Bearer <token> The token should either be a valid ...