Common Response
This section describes the response structure of REST APIs of SwiftFederation solutions. All the response from the REST APIs of SwiftFederation solutions will share the same structure to include the Status-Line, Response Headers and the Response Body.
Response = Status-Line
Response Headers
CRLF
Response Body
In this document, CRLR represents "\r\n" (carriage return and linefeed), and SP represents ' ' (space character).
Status-Line
The first line of a response is the status line. It consists of the protocol version, a numeric status code, and the corresponding reason phrase, separated by space (SP) characters.
Status-Line = HTTP/1.1 Status-Code Reason-Phrase CRLF
Status Code and Reason Phrase
The status codes and the reason phrases are defined in the Status Code.
Response Headers
Provides the essential information about the response from the API endpoints. The common headers defined below will be required in all responses from the REST APIs of SwiftFederation solutions.
Common Headers
HTTP Header | Requirement | Description |
---|---|---|
Content-Type | Mandatory | The content type of the API response. |
x-sfd-trace-id | Mandatory | The unique ID used to trace the exception for investigation. |
Response Body
For a successful response, the response body contains the payload in JSON format. The schema of the JSON object varies according to the response types and is defined in the corresponding API documentation.
For a failed request, the response will contain the error code and error message to indicate the error details.
Field Name | Type | Requirement | Description |
---|---|---|---|
code | string | Mandatory | The error code indicates the specific error. "OK" is used for a successful API call. |
message | string | Mandatory | The error message indicates the error details or the success message. |
Response Example
Successful Response
HTTP/1.1 200
Date: Wed, 06 Aug 2025 04:55:29 GMT
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
x-sfd-trace-id: 0496d18ec7e243a09e0ebd861bdbd81d
{"partnership":1,"name":"Customer_Demo","ingestDomain":null,"industry":"","id":35394,"type":2,"region":"SG","parentId":2,"onboardingType":1}
401 Unauthorised
HTTP/1.1 401
Date: Wed, 06 Aug 2025 09:42:16 GMT
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
x-sfd-trace-id: 83833830e1f94b5586e9187e366c5c7c
{"code":"Signature.NotMatch","message":"The request signature that we calculate does not match the signature that you provided."}