Difference between revisions of "MOR API did create"
From Kolmisoft Wiki
Jump to navigationJump to search
m (moved MOR API did create api to MOR API did create) |
|||
Line 33: | Line 33: | ||
<?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||
<page> | <page> | ||
<status>DID created</status> | <status> | ||
<id>id | <success>DID created</success> | ||
</status> | |||
<did_details> | |||
<id>3</id> | |||
</did_details> | |||
</page> | </page> | ||
<br><br> | <br><br> | ||
Line 41: | Line 45: | ||
'''Errors''' | '''Errors''' | ||
<?xml version="1.0" encoding="UTF-8"?> | |||
* | <page> | ||
* | <status> | ||
* | <error>Error message</error> | ||
* | </status> | ||
* | </page> | ||
* | |||
* | Error messages: | ||
* Incorrect hash – Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string. | |||
* Access Denied – Only Admin, Accountant or Reseller may use API. | |||
* Provider was not found – Enter existing Provider ID. | |||
* Your are not authorized to use this Provider – Specified Provider is not available to this user. | |||
* You are not authorized to manage DIDs – If Accountant or Reseller is using API, they should have all permissions to perform specified actions. | |||
* DID already exists – Enter unique DID number. | |||
* Invalid DID specified – Enter a valid (numeric) DID number. | |||
* DID creation failed – unknown error | |||
<br><br> | <br><br> | ||
=See also= | =See also= | ||
* [[MOR API]] | * [[MOR API]] |
Revision as of 16:56, 29 May 2013
Description
MOR API Create DID
Usage
- Call: /api/did_create
- Methods: POST, GET(if allowed, not recomended)
Parametres
- did - DID number to be created Required.
- provider_id - Provider ID in MOR database, for which DID should be created Required.
- u - username for authentication. Required.
- hash - SHA1 hash constructed using params and API_Secret_Key ( More described in Constructing hash). Required.
Request
We have provider_id = 1, API Secret Key = secret. We want to create DID with number 123456789.
We send:
HTML POST: http://<SERVER_IP>/billing/api/device_create/u=username&did=123456789&provider_id=1&hash=bc2f114099d16656d37e45fd9e8744cb9386d462
Now we can find these DIDs in GUI DID list.
Note that username and password are not included in hash
Returns
Success
<?xml version="1.0" encoding="UTF-8"?> <page> <status> <success>DID created</success> </status> <did_details> <id>3</id> </did_details> </page>
Errors
<?xml version="1.0" encoding="UTF-8"?> <page> <status> <error>Error message</error> </status> </page>
Error messages:
- Incorrect hash – Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
- Access Denied – Only Admin, Accountant or Reseller may use API.
- Provider was not found – Enter existing Provider ID.
- Your are not authorized to use this Provider – Specified Provider is not available to this user.
- You are not authorized to manage DIDs – If Accountant or Reseller is using API, they should have all permissions to perform specified actions.
- DID already exists – Enter unique DID number.
- Invalid DID specified – Enter a valid (numeric) DID number.
- DID creation failed – unknown error