API Module Authentication
From Openprovider API documentation
(Difference between revisions)
(Created page with '==Authentication== {| border="1" cellpadding="4" |- style="background-color:#BBBBBB;" |'''Module''' |''general'' |- style="background-color:#EEEEEE;" |'''Command name''' |''none'…') |
(→Authentication) |
||
(9 intermediate revisions not shown) | |||
Line 3: | Line 3: | ||
|- style="background-color:#BBBBBB;" | |- style="background-color:#BBBBBB;" | ||
|'''Module''' | |'''Module''' | ||
- | |'' | + | |''authentication'' |
|- style="background-color:#EEEEEE;" | |- style="background-color:#EEEEEE;" | ||
|'''Command name''' | |'''Command name''' | ||
Line 9: | Line 9: | ||
|- | |- | ||
|'''Use''' | |'''Use''' | ||
- | |Each API call requires authentication. This can be with a plain text password, or a password hash. To get the password hash, or to reset the password hash, please visit the reseller control panel, section ''contact details''. | + | |Each API call requires authentication. This can be with a plain text password, or a password hash. To get the password hash, or to reset the password hash, please visit the reseller control panel, section ''contact details (Go from menu: Account -> Account overview -> 'Click on the desired contact' -> Show password hash)''. |
|- style="vertical-align:top;" | |- style="vertical-align:top;" | ||
|'''Input''' | |'''Input''' | ||
Line 17: | Line 17: | ||
*'''hash''' (only required if no password is provided) | *'''hash''' (only required if no password is provided) | ||
|- style="vertical-align:top;" | |- style="vertical-align:top;" | ||
- | |'''Output''' | + | |'''Output''' |
| | | | ||
- | + | In case of invalid credentials or hash customer gets error 196: "Authentication/Authorization Failed" | |
|} | |} | ||
Line 42: | Line 42: | ||
===Raw XML=== | ===Raw XML=== | ||
''Please note that newlines and leading spaces are added only for readability. Those whitespaces should be excluded from your XML command before sending it to Openprovider.'' | ''Please note that newlines and leading spaces are added only for readability. Those whitespaces should be excluded from your XML command before sending it to Openprovider.'' | ||
- | + | ||
+ | '''Request: Plain text password''' | ||
<?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||
<openXML> | <openXML> | ||
Line 52: | Line 53: | ||
</openXML> | </openXML> | ||
- | + | '''Request: Hashed password''' | |
<?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||
<openXML> | <openXML> | ||
Line 60: | Line 61: | ||
</credentials> | </credentials> | ||
... | ... | ||
+ | </openXML> | ||
+ | |||
+ | '''Response: in case if credentials are incorrect''' | ||
+ | <?xml version="1.0" encoding="UTF-8"?> | ||
+ | <openXML> | ||
+ | <reply> | ||
+ | <nowiki><code>196</code></nowiki> | ||
+ | <desc>Authentication/Authorization Failed</desc> | ||
+ | <data/></reply> | ||
</openXML> | </openXML> |
Current revision as of 06:03, 10 June 2016
Contents |
Authentication
Module | authentication |
Command name | none |
Use | Each API call requires authentication. This can be with a plain text password, or a password hash. To get the password hash, or to reset the password hash, please visit the reseller control panel, section contact details (Go from menu: Account -> Account overview -> 'Click on the desired contact' -> Show password hash). |
Input |
|
Output |
In case of invalid credentials or hash customer gets error 196: "Authentication/Authorization Failed" |
Examples
Using PHP class
// Plain text password $request = new OP_Request; $request->setCommand('createCustomerRequest') ->setAuth(array('username' => 'username', 'password' => 'password')) ->setArgs(array( ... ));
// Hashed password $request = new OP_Request; $request->setCommand('createCustomerRequest') ->setAuth(array('username' => 'username', 'hash' => '2e1b1611c1e1dba5174ad4cfd1f3b3bd6')) ->setArgs(array( ... ));
Raw XML
Please note that newlines and leading spaces are added only for readability. Those whitespaces should be excluded from your XML command before sending it to Openprovider.
Request: Plain text password
<?xml version="1.0" encoding="UTF-8"?> <openXML> <credentials> <username>username</username> <password>password</password> </credentials> ... </openXML>
Request: Hashed password
<?xml version="1.0" encoding="UTF-8"?> <openXML> <credentials> <username>username</username> <hash>2e1b1611c1e1dba5174ad4cfd1f3b3bd6</hash> </credentials> ... </openXML>
Response: in case if credentials are incorrect
<?xml version="1.0" encoding="UTF-8"?> <openXML> <reply> <code>196</code> <desc>Authentication/Authorization Failed</desc> <data/></reply> </openXML>