MOR API did create

From Kolmisoft Wiki
Revision as of 14:17, 15 January 2013 by Aisteb (talk | contribs)
Jump to navigationJump to search

MOR API Create DID




  • Call: /api/did_create
  • Methods: POST, GET(if allowed, not recomended)
  • Params:
    • did - DID number to be created Required.
    • provider_id - Provider ID in MOR database, for which DID should be created Required.
    • u - username to login. Required.
    • p - password to login. Required.
    • hash - SHA1 hash constructed using params and API_Secret_Key ( More described in Constructing hash). Required.
  • Returns:
    • Success
      • <status>DID created</status>
    • Errors:
      • <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
      • <error>Don't be so smart</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>



Request

http://123.123.123.123/billing/api/device_create/u=admin&p=password&did=123456789&provider_id=1&hash=bc2f114099d16656d37e45fd9e8744cb9386d462

  • admin - owner's username
  • password - owner's password
  • did - DID number
  • provider_id - Provider ID for which DID should be created




           <page>
                 <status>DID created</status>
                 <id>5</id>
           </page>
           <page>
                 <status>DID created</status>
                 <id>6</id>
           </page>
  • Now we can find these DIDs in GUI DID list.

* Note that username and password are not included in hash