Permissions API Documentation

Authentication

 

Authenticates a given client with the API, and generates an authentication token for further API requests.

 

NOTE: using authentication token is optional, you may use your client id and secret instead.

if you choose to use authentication token instead of clientId and secret authentication, replaceAuthClientId and AuthSecret headers with Authkey and set the value to the one returned from this method.

Request POST https://my.domain.com/service/authenticate

 

Fields:

Field Type Description Mandatory
clientId String api client id, generated in key generation page Yes
secret String secret key, generated in key generation page Yes

 

Response

Field Type Description Mandatory
authorization String newly generated authentication token Yes
expires timestamp (int) token expiration timestamp Yes


Request Example

 

#!/bin/bash

clientId=”a153f7d88e51d5756dfecad0f9e27746″

secret=”my_secret”

curl -X POST -d “clientId=${clientId}&secret=${secret}”

“https://my.domain.com/service/authenticate”

 

 

Response Example 

{

“authentication”: “<apiAuthenticationKey>”,

“expires”: 1433438571

}

 

Create User

 

Request URL: https://my.domain.com/svc/users/createUser

Request Method: POST

Request Data:

Field Type Description Mandatory
hostname String The URL of the hostname. Yes
email String The user’s designated email address.
Must be a valid Email Address.
Yes
firstName String The user’s First Name.
The value cannot be empty or more than 32 characters.
Yes
lastName String The user’s Last Name.
The value cannot be empty or more than 32 characters.
Yes
cstid String The External Client ID (If exists) No
pricelistindex Int The position of the price list in the Array (Starting with null). Yes
parentEmail String The Parent email to set the user under. No
setPasswordByEmail Boolean Choose if to send the password Via email or set a password manually No
newPassword String A complex Password If chosen then Yes
verifyPassword String Verify the previous password field.
Both fields must match.
If chosen then Yes
sendValidationEmail Boolean Choose if to send the user an Email validation notification No

 

Response Code: 200

Response Data:

Field Type Description Mandatory
id int The generated client ID Yes

 

Examples:

Request POST https://my.domain.com/svc/users/createUser

{“hostname”: “my.domain.com”,

“email”: “example@domain.co.il”,

“firstName”: “Test”,

“lastName”: “User”,

“cstId”: “”,

“pricelistIndex”: null,

“parentEmail”: “parentemail@domain.com”,

“setPasswordByEmail”: true,

“newPassword”: “”,

“verifyPassword”: “”,

“sendValidationEmail”: true

}

 

Response Code: 200

Response Data:

{

“id”:1230768

}

 

Response Code: 500

Response Data:

 

{“errors”:[{“code”:104,”info”:”failed to create user”,”category”:”General Error”}]}

 

 

{“errors”:[{“code”:121,”info”:”failed to create user”,”category”:”General Error”}]}

 

 

{“errors”:[{“code”:106,”info”:”password verification failed”,”category”:”General Error”}]}

 

 

{“errors”:[{“code”:107,”info”:”failed to create user”,”category”:”General Error”}]}

 

 

{“errors”:[{“code”:100,”info”:”failed to create user”,”category”:”General Error”}]}

 

 

{“errors”:[{“code”:101,”info”:”failed to create user”,”category”:”General Error”}]}

 

Get Users List

 

Request URL:

https://my.domain.com/users/0?auxFilter=0&filter=&from=&hFrom=&hNItems=10&hNext=1&hSkip=0&nItems=500

Request Method: GET

Request Data: No Method Data required


Response Code: 200

Response Data:

Field Type Description Mandatory
id int The client ID Yes
dtCreate String The creation Date and Time of the user Yes
dtExecute String The execution time of the transaction Yes
serviceName String The client Email Address Yes
commandInfo String Transaction title Yes
exitCode int Value of 0 Yes
progress int Value of 100 Yes
warn Boolian The warn state of the client Yes

 

Examples:

Request GET https://my.domain.com/users/0?auxFilter=0&filter=&from=&hFrom=&hNItems=10&hNext=1&hSkip=0&nItems={resultAmount}

resultAmount – The number of values to return in the request.

Request Data:

No Data

Response Code: 200
Response Data:

[{“id”: 761164688,

“dtCreate”: “2021-07-29 13:23:36”,

“dtExecute”: “2021-07-29 13:23:36”,

“dtComplete”: “2021-07-29 13:23:36”,

“serviceName”: “example@domain.co.il”,

“commandInfo”: “Suspend User Account”,

“exitCode”: 0,

“progress”: 100,

“warn”: false

}, {

“id”: 761154146,

“dtCreate”: “2021-07-29 13:02:50”,

“dtExecute”: “2021-07-29 13:02:50”,

“dtComplete”: “2021-07-29 13:02:51”,

“serviceName”: “parentemail@test.com”,

“commandInfo”: “Usage Report Upload 7\/2021”,

“exitCode”: 0,

“progress”: 100,

“warn”: false

}]

 

 

 

 

Delete User

 

Request URL: https://my.domain.com/svc/users/user/{userId}

{userId} – User’s CWM User ID.

Request Method: DELETE

Request Data: No Data


Response Code:  200

There is no response JSON from the server.

 

 

Suspend User

 

Request URL:

https://my.domain.com/svc/userOperations/{userId}/suspend

{userId} – Client ID

Request Method: PUT

JSON that builds the popup window with selectable options for the process:

 

{

    “accountOptions”: [[0, “OK”], [2, “Suspended – Policy”], [4, “Suspended – Billing”]],

    “state”: {

        “account”: 0

    },

    “info”: {

        “email”: “example@domain.co.il”,

        “site”: “my.domain.com”,

        “cstId”: “”

    },

    “services”: []

}

 

 

Request Data:

 

{

“staffId”: -1,

“accountState”: “2”,

“subject”: “”,

“content”: “”,

“services”: []

}

 

 

 

 

Field Type Description Mandatory
staffid Int Yes
accountState String The account state:

 

0 – OK

2 – Suspended – Policy

4 – Suspended – Billing

 

Yes
subject String Leave blank Yes
Content String Leave Default Yes
Services Array Leave Default Yes


Response Code: 200

Response:

 

{

“cmdId”:761164688

}

 

 

Response Data:

The returned value is the transaction ID and is not permanent.

Field Type Description Mandatory
cmdId int The transaction  ID Yes

 

 

Export Usage as CSV

 

Request URL:

https://my.domain.com/svc/usageReport/csvUpload/{MONTH}_{YEAR}/Users

{Month} – Month of the Report – in MM format.

{Year} – Year of the Report – in YYYY format.

Request Method:  POST

Request Data:

Field Type Description Mandatory
Transaction Int 0 – All Transactions

1 – Hourly (per use)

2 – Partial Monthly

3 – Full Month Monthly

4 – Anually

Yes
zipFormat Boolean Keep as true Yes

 

{

“transaction”: 0,

“zipFormat”: true

}

Response Data:

Field Type Description Mandatory
cmdId Int Operation ID Yes
link Boolean Temporary link Yes

 

Example:

Response Code: 200

Response:

 

{

“cmdId”: 761148881,

“link”: “https:\/\/filestore.cloudwm.com\/29-07-2021-gbtye2sr4ytsbbn3es4kkus823m1j72z\/UsageReport-self-All_Transactions-2021-07-01-2021-07-31.zip”

}

 

 

Have additional questions? Search below: