Update Roles for Credit Application
This endpoint allows you to update the roles associated with a specific credit application in the system.
Request
-
Method: POST
-
URL:
{{url}}/api/method/emotive_app.api.crm.credit_app.update_roles
Request Body
The request body must be in JSON format and should include the following parameters:
-
doctype (string): The type of document you are updating. In this case, it should be set to
"Credit Application". -
docname (string): The unique identifier of the credit application you wish to update. For example,
"C-2024-08-00014". -
new_roles (object): An object containing the new roles to be assigned. Each key-value pair represents a unique identifier for a role and its corresponding role description. For example:
-
"2024-CA-08-000019": "Buyer" -
"2024-CA-08-000035": "Co Buyer 1"
-
Example Request Body
{
"doctype": "Credit Application",
"docname": "C-2024-08-00014",
"new_roles": {
"2024-CA-08-000019": "Buyer",
"2024-CA-08-000035": "Co Buyer 1"
}
}
Response
The expected response is a JSON object that confirms the operation. It includes:
- message (string): A confirmation message regarding the update operation. An empty string indicates that the operation was successful.
Example Response
{
"message": ""
}
Notes
-
Ensure that the
docnamecorresponds to an existing credit application in the system. -
The roles provided in
new_rolesshould be valid and recognized by the application. -
This endpoint is critical for managing user roles within credit applications, so it should be used with caution.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Request Method
- POST
End Point
{{url}}/api/method/emotive_app.api.crm.credit_app.update_rolesExample Request
{
"doctype": "Credit Application",
"docname": "C-2024-08-00014",
"new_roles": {
"2024-CA-08-000019": "Buyer",
"2024-CA-08-000035": "Co Buyer 1"
}
}Response Explanation
A successful response will return a confirmation message.
Response Body Parameters
- message (
string)
Status message, typically"Ok"on success.
Example Response
{
"message": "Ok"
} 400Bad Request
403Forbidden
409Conflict
422Unprocessable Entity
500Internal Server Error
