Update Roles on Credit Application

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 docname corresponds to an existing credit application in the system.

  • The roles provided in new_roles should 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.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Request Method

  • POST

End Point

{{url}}/api/method/emotive_app.api.crm.credit_app.update_roles

Example 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"
}
Body Params
string
required
Defaults to Credit Application

Document type - must be "Credit Application"

string
required
Defaults to C-2024-08-00014

Unique identifier of the credit application

json
required
Defaults to { "2024-CA-08-000019":"Buyer", "2024-CA-08-000035":"Co Buyer 1" }

Object mapping applicant IDs to their new roles

Headers
string
required
Defaults to <Token>
Responses

400

Bad Request

403

Forbidden

409

Conflict

422

Unprocessable Entity

500

Internal Server Error

Language
Credentials
Header
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json