Requests

Client Authentication

This request needs to be performed in order to obtain a JWT that allows access to API.

@apiVersion 1.0.0
@apiRequest {post} 1/authenticate
@apiParam {String} access_token Access Token needed for authenticate the request
@apiParam {Integer} _requested_at Timestamp of length 13 representing when the request was called
@apiSuccessResponse {String} JWT that can be used for API authorization
@apiSuccessResponseExample
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.
eyJpc3MiOiJkcG1zLWN1c3RvbWVyLXNjcmVlbiIsImlhdCI6MTU2NDAxMDg4NSwiZGF0YSI6eyJfcmVxdWVzdGVkX2F0IjoiODA2NDY0ODAwMDAwIn19.
h55TT5jcMHTaduei2tT4UqyOyz87aVK20_40-2xfY9w"
@apiFailedResponse {Integer} status Response Status (0)
@apiFailedResponse {Integer} error_code Response Error Code
@apiFailedResponse {String} errors Response Detected errors
@apiFailedResponseExample {JSON Format} {"status":0,"error_code":400,"errors":"Invalid Access token"}

Check what fields are needed for Request a Case

A 3rd Party is able to make request via POST to /1/requests/information in order to obtain information of fields needed for requesting a case.

@apiVersion 1.0.0
@apiRequest {post} 1/requests/information
@apiParam {String} webform_id Webform ID of the frontend
@apiSuccessResponse {Integer} status Response status (1).
@apiSuccessResponse {Array} data Data of the inserted case.
@apiSuccessResponseExample
{
"status": 1,
"data": [
{
"fields": {
"Campo_0": {
"name": "xxxxxx",
"type": "textbox",
"max_length": "80",
"mandatory": true
},
.
.
.
"Campo_2": {
"name": "xxxxxx",
"type": "email",
"max_length": "120",
"mandatory": true
}
},
"authorization_methods": [
"ldap",
"email"
]
}
}
@apiFailedResponse {Integer} status Response Status (0)
@apiFailedResponse {Integer} error_code Response Error Code
@apiFailedResponse {String} errors Response Detected errors
@apiFailedResponseExample {JSON Format} {"status":0,"error_code":400,"errors":"Invalid Access token"}

Request a Case

  • API request for creating a case is available and properly working for starting a simple case without authorization methods.

  • This resquests response to client with the complete info of the case as this is needed for Customer Screen to conitnue with the proccess. If this requests is going to be used for 3rd Parties, response should only be a status of the case with the corresponding ID or UserFriendlyID.

  • When authorization methods are available, so it might need to be properly analized:

    • Requesting a case is ignoring authorization methods if them are not set on the request of the body.
    • With email active as authorization method, request is never created and email is never send. Seems like this process is finished on Customer Screen Controller instead of API.
    • Authorization combinations needs to be checked deeply, mostly the ones including login like when LDAP is up.
@apiVersion 1.0.0
@apiRequest {post} 1/requests/create
@apiParam {String} if_config_id Config ID of the frontend
@apiParam {String} _id For Internal Use
@apiParam {String} campo_0 Field 0 in frontend
@apiParam {String} campo_1 Field 1 in frontend
@apiParam {String} .
@apiParam {String} .
@apiParam {String} campo_n Field n in frontend
@apiParam {String} authorization_method Fields required for the authorization methods (mail, password, MTAN, etc)
@apiSuccessResponse {Integer} status Response status (1).
@apiSuccessResponse {Array} data Data of the inserted case.
@apiSuccessResponseExample
{
"status": 1,
"data": {
"_id":" MongoDB\BSON\ObjectID",
"if_config_id": "000000000000000000000000",
"authorization_method": [],
"status": "Open",
"no_data": false,
"created_at": 0000000000000,
"updated_at": 0000000000000,
"download_at": null,
"assigned_id": null,
"deadline_extend": null,
"rescheduled_till": null,
"decline": null,
"logs": [ "***All logs here*** " ],
"workflow": { "*** All Workflow info here ***" },
"variables": [ "*** All Variables info here ***" ],
"encoded_id": "X - XXXX - XXXX - XXXX",
"initialized": true,
"last_exception_message": null,
"exception_count": null,
"current_processor": null,
"completed_at": null,
"_encoded_id": "xxxxxxxxxxxxx"
}
}
@apiFailedResponse {Integer} status Response Status (0)
@apiFailedResponse {Integer} error_code Response Error Code
@apiFailedResponse {String} errors Response Detected errors
@apiFailedResponseExample {JSON Format} {"status":0,"error_code":400,"errors":"Invalid Access token"}

Download Case Data

  • Currently, collecting data is performed on Customer Screen Controllers via some API requests, that would end on a generated zip, so an specific request for this didnt exisits.

  • An API request dedicated for this was created, so a 3rd Party is able to make POST request with a transfer method data that allows downloads:

curl -X POST https://test1.raptorcompliance.com:25445/1/requests/customer-data -H 'Authorization: Bearer (JWT)' -d case_id=(user_friendly_id) --output customer_data.zip
  • Still need to change Customer Screen for using API instead the current method described in first point.
@apiVersion 1.0.0
@apiRequest {post} 1/requests/customer-data
@apiParam {String} case_id User friendly ID
@apiExample {curl} Request can be performed via curl with the following format
curl -X POST https://dpms.domain:25445/1/requests/customer-data
-H 'Authorization: Bearer (JWT)' -d case_id=(user_friendly_id)
--output customer_data.zip
@apiSuccessResponse {binary} Binary data with ZIP format ready to be output to a file
@apiFailedResponse {Integer} status Response Status (0)
@apiFailedResponse {Integer} error_code Response Error Code
@apiFailedResponse {String} errors Response Detected errors
@apiFailedResponseExample {JSON Format} {"status":0,"error_code":400,"errors":"Invalid Access token"}