Responses

Every response body returned by Uanataca is JSON object.

If the response is successful, the content of the JSON depends on the API queried.

Instead, the error response is always composed of these keys:

Key Description
error A string that describe the error occured
code The HTTP error code related
id The unique identifier of the error generated by Uanataca

A successful response:


            [
                {
                    "data": "MIIHyTCCBbGgAwIBAgIIcO...",
                    "profile": "PFnubeAF",
                    "subject": "CN=RAO COFTenerife API, 2.5.4.5=TINIT-TSTAPI74S23C129Y, 2.5.4.42=RAO, 2.5.4.4=API, C=ES",
                    "issuer": "2.5.4.97=VATES-A66721499, CN=UANATACA CA1 2016, OU=AC-UANATACA, O=UANATACA S.A., L=Barcelona (see current address at www.uanataca.com/address), C=ES",
                    "valid_from": "2018-10-16T16:41:00",
                    "valid_to": "2020-10-15T16:41:00",
                    "serial_number": "70e07489bfccd478",
                    "status": 0,
                    "pk": 1980,
                    "revokation_reason": null,
                    "type": "FIRSTISSUE"
                }
            ]

An error response:


            {
                "code": "500",
                "id": "8e782cdcdb600a90",
                "error": "Invalid ScratchCard"
            }

Another error response:


            {
                "code": "418",
                "id": "551eb335898f79e4",
                "error": "Invalid paramiters"
            }

HTTP Status Codes

Below a list of HTTP codes that can be returned by Uanataca.

Code Description
200 Everything went OK. The server elaborated correctly the request and returned the response to the client.
201 The object is successfully Created with the parameters sent by the client.
202 The request sent by the client has been Accepted and is under process.
204 No Content. The operation was successful but no content is provided in the response body.
400 Bad Request. The parameters sent, are not well formatted or are missing.
401 Unauthorized. The user used for making the request is not authorized to consume that resource.
403 Forbidden. The user used for making the request has no permissions to do it.
404 The resource requested is Not Found.
405 Method not allowed. The endpoint called has not the method specified.
412 Precondition Failed. The operation has some requirements that are not satisfied. For example if a Request is in a wrong state for the operation requested.
429 Too Many Requests.
500 Internal Server Error. An error occured during the elaboration of the request.
502 Bad Gateway.
503 Service Unavailable.