Skip to content

Sales Office

Overview

The Sales Office API enables the creation, retrieval, updating, and deletion of sales office records. This documentation provides detailed information on the endpoints, request and response formats, and field descriptions.

Create

Endpoint: /api/message/sls_off/{ Company }

This API will creat new Sales Office.

  • Method: POST
  • Content-Type: application/json
  • Authentication: Bearer <token>

Request Body:

json
{
    "data_set": "<Data_set>",               //string
    "sls_off": "<Sales-Office>",            //string
    "dsca": "<Sales-office-description>",   //string
}

Fields Details:

Field NameDescriptionData TypeLength
data_setData SetString10
sls_offSales OfficeString6
dscaSales Office DescriptionString120

Response Body: (Status: 200)

json
{
    "data_set": "<Data_set>",             
    "dsca": "<Sales-office-description>",
    "sls_off": "<Sales-Office>",            
}

Fields Details:

FieldDescriptionData TypeExample
data_setData SetString"Dataset1"
dscaSales Office DescriptionString"Sales In"
sls_offSales OfficeString"SIS"

Response Body: (Status: 401 - Unauthorized)

When there is no token or invalid token passed:

json
{
    "message": "Unauthorized!"
}

Response Body: (Status: 400 - Bad Request)

When both the Data set and Sales office is already present in the database:

json
{
    "message": "Record already exists!"
}

Response Body: (Status: 400 - Bad Request)

When invalid or wrong Data set is passed:

json
{
    "message": "Reference Error"
}

Response Body: (Status: 400 - Bad Request)

When there is an invalid data type is passed:

json
{
    "message": "Invalid Data Type"
}

Response Body: (Status: 500 - Internal Server Error)

When the mandatory fields are passed as an empty field:

json
{
    "message": "Validation Errors|Validation 'isNotEmpty' failed for field 'data_set'"
}

Update

Endpoint: /api/message/sls_off/{ Company }

This API will update a Sales Office.

  • Method: PUT
  • Content-Type: application/json
  • Authentication: Bearer <token>

Request Body:

json
{
    "data_set": "<Data_set>",               //string
    "sls_off": "<Sales-Office>",            //string
    "dsca": "<Sales-office-description>",   //string
}

Response Body: (Status: 200)

json
{
    "data_set": "<Data_set>",             
    "dsca": "<Sales-office-description>",
    "sls_off": "<Sales-Office>", 
}

Response Body: (Status: 401 - Unauthorized)

When there is no token or invalid token passed:

json
{
    "message": "Unauthorized!"
}

Response Body: (Status: 400 - Bad Request)

When there is an invalid data type is passed:

json
{
    "message": "Invalid Data Type"
}

Response Body: (Status: 400 - Bad Request)

When you are trying to update the both the Data set and Sales office:

json
{
    "message": "Record not found!"
}

Response Body: (Status: 500 - Internal Server Error)

When the mandatory fields are passed as an empty field:

json
{
    "message": "Validation Errors|Validation 'isNotEmpty' failed for field 'data_set'"
}

Delete

Endpoint: /api/message/sls_off/{ Company }/{ record_id }

This API will delete a Sales Office.

  • Method: DELETE
  • Authentication: Bearer <token>

Response Body: (Status: 200)

json
{
    "Message": "Message Deleted Sucessfully!"
}

Response Body: (Status: 401 - Unauthorized)

When there is no token or invalid token passed:

json
{
    "message": "Unauthorized!"
}

Response Body: (Status: 500 - Internal Server Error)

When invalid or wrong Sales Office id is paased:

json
{
    "Message": "Unable to Delete Record - Invalid Data Type"
}

Get

Endpoint: /api/message/sls_off/{ Company }/{ record_id }

This API will get a Sales Office.

  • Method: GET
  • Authentication: Bearer <token>

Response Body: (Status: 200)

json
{
    "data_set": "<Data_set>",             
    "dsca": "<Sales-office-description>",
    "sls_off": "<Sales-Office>", 
}

Response Body: (Status: 200)

When invalid or wrong Sales Office id is paased:

json
{
    "message": "null"
}

Response Body: (Status: 401 - Unauthorized)

When there is no token or invalid token passed:

json
{
    "message": "Unauthorized!"
}

Get All

Endpoint: /api/messages/sls-off/{ Company }/{ PageSize }/{ PageNumber }

This API will get all Sales Offices.

  • Method: GET
  • Authentication: Bearer <token>

Response Body: (Status: 200)

json
[
  {
    "data_set": "<Data_set>",             
    "dsca": "<Sales-office-description>",
    "sls_off": "<Sales-Office>", 
  },
  .
  .
  .
]

Response Body: (Status: 401 - Unauthorized)

When there is no token or invalid token passed:

json
{
    "message": "Unauthorized!"
}