Difference between revisions of "MOR API did create"
From Kolmisoft Wiki
Jump to navigationJump to search
Line 1: | Line 1: | ||
=Description= | |||
<!-- This functionality is available from MOR X3 --> | |||
[[MOR API]] Create DID | [[MOR API]] Create DID | ||
<br><br> | <br><br> | ||
=Usage= | |||
* Call: /api/did_create | * Call: /api/did_create | ||
* Methods: POST, GET(if allowed, not recomended) | * Methods: POST, GET(if allowed, not recomended) | ||
<br><br> | <br><br> | ||
== Request == | ===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'''. | |||
* [[MOR API hash construction | hash]] - SHA1 hash constructed using '''params''' and '''API_Secret_Key''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''. | |||
<br><br> | |||
===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''' | |||
<br><br> | |||
===Returns=== | |||
'''Success''' | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<page> | |||
<status>DID created</status> | |||
<id>id of new DID</id> | |||
</page> | |||
<br><br> | <br><br> | ||
---- | ---- | ||
'''Errors''' | |||
* | * <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string. | ||
** | * <error>Access Denied</error> - Only Admin, Accountant or Reseller may use API. | ||
* | * <error>Provider was not found</error> - Enter existing Provider ID. | ||
* <error>Your are not authorized to use this Provider</error> - Specified Provider is not available to this user. | |||
* <error>You are not authorized to manage DIDs</error> - If Accountant or Reseller is using API, they should have all permissions to perform specified actions. | |||
* <error>DID already exists</error> - Enter unique DID number. | |||
* <error>Invalid DID specified</error> - Enter a valid (numeric) DID number. | |||
* <error>DID creation failed</error> | |||
<br><br> | |||
=See also= | |||
* [[MOR API]] |
Revision as of 09:40, 25 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>DID created</status> <id>id of new DID</id> </page>
Errors
- <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
- <error>Access Denied</error> - Only Admin, Accountant or Reseller may use API.
- <error>Provider was not found</error> - Enter existing Provider ID.
- <error>Your are not authorized to use this Provider</error> - Specified Provider is not available to this user.
- <error>You are not authorized to manage DIDs</error> - If Accountant or Reseller is using API, they should have all permissions to perform specified actions.
- <error>DID already exists</error> - Enter unique DID number.
- <error>Invalid DID specified</error> - Enter a valid (numeric) DID number.
- <error>DID creation failed</error>