Dispute Attachment API
The Dispute Attachment API offers ODR Institutions a streamlined mechanism to effortlessly transmit files and updates pertinent to disputes within their platforms. This endpoint facilitates the automated transfer of both dispute data and associated attachments from the source ODR Institution to the SMART ODR Portal.
This API endpoint is designed to handle updates related to dispute resolution cases. It allows users to submit files, along with additional information, to provide updates on a dispute. The API performs various checks on the submitted data and files to ensure the integrity of the process.
Endpoint
POST https://<apiserver>.smartodr.com/resource-handler
Versioning
The Dispute Attachment API is a versioned API. Updates are released quarterly.
Initial Release:
- Version
1.0.0
- Version
Adding a New Feature:
- Version
1.1.0
- Version
Fixing a Bug:
- Version
1.1.1
- Version
Making a Backward-Incompatible Change:
- Version
2.0.0
- Version
Authentication
All incoming requests from ODR Institutions will include a valid access token in the Authorization header. SMART ODR should validate this token to ensure the request is from the respective ODR Institutions.
Authorization : `Signature keyId="${unique_key_id}|${token}|RS256" algorithm="RS256" type="attachment" `
unique_key_id : Unique token generated by ODR Institutions from SMART ODR Portal
token : Signed JWT Token [RS256]
Token Payload
The payload of the JWT includes the following information:
- email: The primary email address of the user associated with the ODR Institution.
- phone: The primary phone number of the user associated with the ODR Institution.
Content-Type: multipart/form-data
Authorization: Provide the necessary authentication token
Request Body Parameters
Field | Data Type | Description |
---|---|---|
disputeId | String | Unique identifier for the dispute. |
disputetype | String | Type of dispute. |
role | String | Role of the user making the update (e.g., User, Administrator). |
userName | String | User's name initiating the update. |
description | String | Brief description of the update. |
User Reference Table
Role | Description |
---|---|
MEDIATOR | Mediator |
ARBITRATOR | Arbitrator |
SYSADMIN | System Administrator |
CASEMANAGER | Case Manager |
PETITIONER | Petitioner |
RESPONDENT | Respondent |
Example:
{
"dispute": "{ \"disputeId\": \"123456\", \"disputetype\": \"TypeA\", \"role\": \"RESPONDENT\", \"userName\": \"JohnDoe\", \"description\": \"Update on dispute\" }"
}
File Upload Example
To upload a file, include the file(s) in the request payload using form-data
. Ensure that the file content is uploaded as binary data. Below is an example using curl
:
curl -X POST \
-H "Content-Type: multipart/form-data" \
-H "Authorization: Bearer YOUR_AUTH_TOKEN" \
-F "files=@example-file.pdf" \
-F "dispute={ \"disputeId\": \"123456\", \"disputetype\": \"TypeA\", \"role\": \"User\", \"userName\": \"JohnDoe\", \"description\": \"Update on dispute\" }" \
https://api.example.com/resource-handler
The files parameter expects the binary content of the file, and @example-file.pdf is the path to the file on your local machine.
The dispute parameter contains the JSON string with information about the dispute update, as described in the previous section.
Success Response
If the update is successful, the API returns a 200 OK
status along with a JSON object containing relevant information.
Fields in the Response
Field | Data Type | Description |
---|---|---|
success | Boolean | Indicates whether the update was successful (true ) or (false ). |
message | String | A brief message indicating the status or outcome of the update. |
fileCount | Number | The number of files successfully uploaded as part of the update. |
disputeData | Object | Parsed dispute data extracted from the request body. |
Example:
{
"success": true,
"message": "Update to the Dispute 123456 received",
"fileCount": 2,
"disputeData": { /* Parsed dispute data from the request body */ }
}
Error Response
Fields in the Response
Field | Data Type | Description |
---|---|---|
success | Boolean | Indicates whether the update was successful (true ) or (false ). |
message | String | A detailed error message describing the issue. |
{
"success": false,
"message": "Error message describing the issue"
}