PowerAuth Cloud API - General Principles

This documentation covers the general shared principles of PowerAuth Cloud APIs.

Content Type

All services expect to work with the JSON request and response. Use Content-Type: application/json header when calling the services:

Content-Type: application/json

Error Handling

In the case of an error, all endpoints will return the response in the following base format:

{
  "status": "ERROR",
  "responseObject": {
    "code": "${ERROR_CODE}",
    "message": "${ERROR_MESSAGE}"
  }
}
Attribute Type Description
status* String Always the ERROR string.
responseObject.code* String Error code.
responseObject.message* String Error message with more info about the issue.

Failing the Basic Request Validation

If request validation fails on the syntactic level, the service will return 400 Bad Request response with the following extended structure:

{
  "status": "ERROR",
  "responseObject": {
    "code": "ERROR_REQUEST",
    "message": "Required Long parameter 'timestampFrom' is invalid",
    "violations": [
      {
        "fieldName": "getAuditLog.timestampFrom",
        "invalidValue": -1000,
        "hint": "must be greater than or equal to 0"
      }
    ]
  }
}
Attribute Type Description
status* String Always the ERROR string.
responseObject.code* String Error code, always the value ERROR_REQUEST.
responseObject.message* String Information about the violation.
responseObject.violations Object[] Information about the specific fields that were invalid.
responseObject.violations[].fieldName* String Field name.
responseObject.violations[].invalidValue* - The invalid value that was provided.
responseObject.violations[].hint* String Hint on why the validation failed.

Security

All services are protected by the Basic HTTP authentication. Failure to provide correct username or password will result in the 401 Unauthorized error with the following response body:

{
  "status": "ERROR",
  "responseObject": {
    "code": "HTTP_401",
    "message": "Unauthorized"
  }
}
Last updated on Dec 28, 2022 (21:40) View product
Search

develop

PowerAuth Cloud