Back to top

Contacts APIs

Overview

The Contacts API provides endpoints for managing contacts in the WasteLinq system. You can use these endpoints to retrieve a list of contacts, view contact details, update contact information, and more. These are RESTful APIs and use standard HTTP methods like GET, POST, PUT, and DELETE. The APIs uses the Bearer token for authentication. You can obtain the token by logging in to the WasteLinq system.

Bearer Token

A bearer token is a type of access token that is used for authorization in APIs. It is a cryptic string that is generated by the server in response to a login request. The client must send this token in the Authorization header when making requests to protected resources.

The “Bearer” keyword is a signal to the server that the token is a type of bearer token. Here’s an example of how to use it:

Authorization: Bearer <Your-Bearer-Token>

Replace with your actual bearer token.

For example:

Authorization: Bearer 5262d64b892e8d4341000001

Error Messages

  • 400 Bad Request: This error is returned when the server could not understand the request due to invalid syntax. Check your request body and parameters.

  • 401 Unauthorized: This error is returned when the request lacks valid authentication credentials for the target resource. Make sure your API key is correct.

  • 403 Forbidden: This error is returned when the server understood the request, but it refuses to authorize it. This status is often returned if you’re missing permissions to access the resource.

  • 404 Not Found: This error is returned when the server can’t find the requested resource. Check your endpoint and parameters.

  • 500 Internal Server Error: This error is returned when the server encounters an unexpected condition that prevented it from fulfilling the request.

Contact

contact_data

contact_data
GET/api/tools/contact_data/{?page,pageSize,selectedFields,filter,sort}

Overview:

The contact_data endpoint, accessible at /api/tools/contact_data, is a GET request that is used to retrieve a list of contacts.

Request Body and Response Description:

Name Data Type Description
success boolean Indicates whether the operation was successful.
content array An array of contacts.
id number The unique identifier for the contact.
contactNumber number The contact number.
fullName string The full name of the contact.
companyName string The name of the company.
title string The title of the contact.
phone string The phone number of the contact.
email string The email address of the contact.
status string The status of the contact.
totalElements number The total number of elements.

Example URI

GET [Contacts APIs](https://test-api.wastelinq.com)./api/tools/contact_data/?page=&pageSize=&selectedFields=&filter=&sort=
URI Parameters
HideShow
page
number (optional) 

The page number.

pageSize
number (optional) 

The number of items per page.

selectedFields
string (optional) 

The fields to be selected.

filter
string (optional) 

The filter to be applied.

sort
string (optional) 

The sort order.

Request
HideShow
Headers
Content-Type: application/json
Authorization: {TOKEN}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "content": [
    {
      "id": 34451,
      "contactNumber": 34886,
      "fullName": "Accounts Payable",
      "companyName": "Company ABC",
      "title": "",
      "phone": "222-222-2222",
      "email": "janedoe@wastelinq.com",
      "status": "Active"
    },
    {
      "id": 34452,
      "contactNumber": 34887,
      "fullName": "Jane Doe",
      "companyName": "Company ABC",
      "title": "",
      "phone": "",
      "email": "janedoe@wastelinq.com"",
      "status": "Active"
    }
  ],
  "totalElements": 3978
}

contact_edit

contact_edit
GET/api/tools/contact/edit/{contact_id}/

Overview:

The contact_edit endpoint, accessible at /api/tools/contact/edit/{contact_id}/, is a GET request that is used to retrieve the details of a contact.

Request Body and Response Description:

Name Data Type Description
success boolean Indicates whether the operation was successful.
content object The contact details.
First_Name string The first name of the contact.
Last_Name string The last name of the contact.
Title string The title of the contact.
Address1 string The first address of the contact.
Address2 string The second address of the contact.
City string The city of the contact.
State string The state of the contact.
Zip string The zip code of the contact.
IsInactive boolean Indicates whether the contact is inactive.
facilityContact array An array of facility contacts.
vendorContact array An array of vendor contacts.
genMasterContact array An array of general master contacts.
billtoContact array An array of bill-to contacts.
name string The name of the contact.
contactPhone array An array of contact phone numbers.
Label string The label of the phone number.
Phone_Number string The phone number.
Phone_Ext string The phone extension.
contactEmail array An array of contact email addresses.
Label string The label of the email address.
Email string The email address.

Example URI

GET [Contacts APIs](https://test-api.wastelinq.com)./api/tools/contact/edit/contact_id/
URI Parameters
HideShow
contact_id
number (required) 

The contact ID.

Request
HideShow
Headers
Content-Type: application/json
Authorization: {TOKEN}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "content": {
    "First_Name": "Accounts",
    "Last_Name": "Payable",
    "Title": null,
    "Address1": null,
    "Address2": null,
    "City": null,
    "State": null,
    "Zip": null,
    "IsInactive": false,
    "facilityContact": [],
    "vendorContact": [],
    "genMasterContact": [],
    "billtoContact": [
      {
        "name": "Company ABC"
      },
      {
        "name": "Company ABCA"
      },
      {
        "name": "Company ABCB"
      },
      {
        "name": "Company ABCC"
      }
    ],
    "contactPhone": [
      {
        "Label": "Work",
        "Phone_Number": "222-222-2222",
        "Phone_Ext": null
      }
    ],
    "contactEmail": [
      {
        "Label": "Work",
        "Email": "janedoe@wastelinq.com"
      }
    ]
  }
}

contact_edit

contact_edit
PUT/api/tools/contact/edit/

Overview:

The contact_edit endpoint, accessible at /api/tools/contact/edit/{contact_id}/, is a PUT request that is used to update the details of a contact.

Request Body and Response Description:

Name Data Type Description
First_Name string The first name of the contact.
Last_Name string The last name of the contact.
Title string The title of the contact.
Address1 string The first address of the contact.
Address2 string The second address of the contact.
City string The city of the contact.
State string The state of the contact.
Zip string The zip code of the contact.
IsInactive boolean Indicates whether the contact is inactive.
facilityContact array An array of facility contacts.
vendorContact array An array of vendor contacts.
genMasterContact array An array of general master contacts.
billtoContact array An array of bill-to contacts.
name string The name of the contact.
contactPhone array An array of contact phone numbers.
Label string The label of the phone number.
Phone_Number string The phone number.
Phone_Ext string The phone extension.
contactEmail array An array of contact email addresses.
Label string The label of the email address.
Email string The email address.

Example URI

PUT [Contacts APIs](https://test-api.wastelinq.com)./api/tools/contact/edit/
Request
HideShow
Headers
Content-Type: application/json
Authorization: {TOKEN}
Body
{
  "First_Name": "Accounts",
  "Last_Name": "Payable",
  "Title": null,
  "Address1": null,
  "Address2": null,
  "City": null,
  "State": null,
  "Zip": null,
  "IsInactive": false,
  "facilityContact": [],
  "vendorContact": [],
  "genMasterContact": [],
  "billtoContact": [
    {
      "name": "Company ABC"
    },
    {
      "name": "Company ABCA"
    },
    {
      "name": "Company ABCB"
    },
    {
      "name": "Company ABCC"
    }
  ],
  "contactPhone": [
    {
      "Label": "Work",
      "Phone_Number": "222-222-2222",
      "Phone_Ext": null
    }
  ],
  "contactEmail": [
    {
      "Label": "Work",
      "Email": "janedoe@wastelinq.com"
    }
  ]
}
Response  200

get_contact_type

get_contact_type
GET/api/lookup/get_contact_type/

Overview:

The get_contact_type endpoint, accessible at /api/lookup/get_contact_type/, is a GET request that is used to retrieve a list of contact types.

Request Body and Response Description:

Name Data Type Description
id number The unique identifier for the contact type.
Name string The name of the contact type.
Broker number The broker ID.

Example URI

GET [Contacts APIs](https://test-api.wastelinq.com)./api/lookup/get_contact_type/
Request
HideShow
Headers
Content-Type: application/json
Authorization: {TOKEN}
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": 158,
    "Name": "Customer Primary",
    "Broker": 31
  },
  {
    "id": 159,
    "Name": "Site Secondary",
    "Broker": 31
  },
  {
    "id": 160,
    "Name": "Accounts Payable",
    "Broker": 31
  },
  {
    "id": 161,
    "Name": "Site Primary",
    "Broker": 31
  },
  {
    "id": 162,
    "Name": "Profile Contact",
    "Broker": 31
  },
  {
    "id": 268,
    "Name": "Customer Secondary",
    "Broker": 31
  },
  {
    "id": 598,
    "Name": "Refactor",
    "Broker": 31
  }
]

get_master_contact

get_master_contact
GET/api/tools/contact/get_master_contact/{contact_id}/

Overview:

The get_master_contact endpoint, accessible at /api/tools/contact/get_master_contact/{contact_id}/, is a GET request that is used to retrieve the details of a master contact.

Request Body and Response Description:

Name Data Type Description
company string The company name.
Phone array An array of phone numbers.
id number The unique identifier for the phone number.
label string The label of the phone number.
number string The phone number.
number_ext string The phone extension.
isSelectLabel boolean Indicates whether the label is selected.
Email array An array of email addresses.
id number The unique identifier for the email address.
label string The label of the email address.
email string The email address.
isSelectLabel boolean Indicates whether the label is selected.
id number The unique identifier for the contact.
First_Name string The first name of the contact.
Last_Name string The last name of the contact.
Title string The title of the contact.
Address1 string The first address of the contact.
Address2 string The second address of the contact.
City string The city of the contact.
State string The state of the contact.
Zip string The zip code of the contact.
IsInactive boolean Indicates whether the contact is inactive.
Original_Phone string The original phone number.
Original_Email string The original email address.

Example URI

GET [Contacts APIs](https://test-api.wastelinq.com)./api/tools/contact/get_master_contact/contact_id/
URI Parameters
HideShow
contact_id
number (required) 

The contact ID.

Request
HideShow
Headers
Content-Type: application/json
Authorization: {TOKEN}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "company": "",
  "Phone": [
    {
      "id": 0,
      "label": "Work",
      "number": "222-222-2222",
      "number_ext": "",
      "isSelectLabel": false
    }
  ],
  "Email": [
    {
      "id": 0,
      "label": "Work",
      "email": "janedoe@gmail.com",
      "isSelectLabel": false
    }
  ],
  "id": 87554,
  "First_Name": "Jane Doe",
  "Last_Name": "Phd",
  "Title": null,
  "Address1": null,
  "Address2": null,
  "City": null,
  "State": null,
  "Zip": null,
  "IsInactive": false,
  "Original_Phone": "222-222-2222",
  "Original_Email": "janedoe@gmail.com"
}

get_contact_by_search_ajax

get_contact_by_search_ajax
GET/api/tools/get_contact_by_search_ajax/{?page,pageSize,selectedFields,filter,sort}

Overview:

The get_contact_by_search_ajax endpoint, accessible at /api/tools/get_contact_by_search_ajax, is a GET request that is used to search for contacts.

Request Body and Response Description:

Name Data Type Description
success boolean Indicates whether the operation was successful.
content array An array of contacts.
id number The unique identifier for the contact.
firstName string The first name of the contact.
lastName string The last name of the contact.
title string The title of the contact.
phone string The phone number of the contact.
email string The email address of the contact.
totalElements number The total number of elements.

Example URI

GET [Contacts APIs](https://test-api.wastelinq.com)./api/tools/get_contact_by_search_ajax/?page=&pageSize=&selectedFields=&filter=&sort=
URI Parameters
HideShow
page
number (optional) 

The page number.

pageSize
number (optional) 

The number of items per page.

selectedFields
string (optional) 

The fields to be selected.

filter
string (optional) 

The filter to be applied.

sort
string (optional) 

The sort order.

Request
HideShow
Headers
Content-Type: application/json
Authorization: {TOKEN}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "content": [
    {
      "id": 34933,
      "firstName": "Jane",
      "lastName": "Doe",
      "title": null,
      "phone": "222-222-2222",
      "email": "janedoe@wastelinq.com"
    }
  ],
  "totalElements": 3874
}

edit_contact_with_json

edit_contact_with_json
POST/api/tools/contact/edit_contact_with_json/{customer_id}/

Overview:

The edit_contact_with_json endpoint, accessible at /api/tools/contact/edit_contact_with_json/{customer_id}/, is a POST request that is used to update the details of a contact.

Request Body and Response Description:

Name Data Type Description
success boolean Indicates whether the operation was successful.
Vendor_Number string The vendor number.
Master_Contact object The master contact details.
Company string The company name.
Phone string The phone number.
Email string The email address.
contactTypes array An array of contact types.
id number The unique identifier for the contact type.
name string The name of the contact type.
Contact_Number number The contact number.
First_Name string The first name of the contact.
Last_Name string The last name of the contact.
Title string The title of the contact.
Address1 string The first address of the contact.
Address2 string The second address of the contact.
City string The city of the contact.
State string The state of the contact.
Zip string The zip code of the contact.
Status string The status of the contact.
Created_date string The date the contact was created.
Modified_date string The date the contact was last modified.
IsInactive boolean Indicates whether the contact is inactive.
User number The user ID.
Broker number The broker ID.
Cust_Contact number The customer contact number.
Contact_Type string The contact type.

Example URI

POST [Contacts APIs](https://test-api.wastelinq.com)./api/tools/contact/edit_contact_with_json/customer_id/
URI Parameters
HideShow
customer_id
number (required) 

The customer ID.

Request
HideShow
Headers
Content-Type: application/json
Authorization: {TOKEN}
Body
{
  "Email": [
    {
      "email": "janedoe@wastelinq.com",
      "label": "Work",
      "id": "0",
      "isSelectLabel": false
    }
  ],
  "Phone": [
    {
      "number_ext": null,
      "number": "222-222-2222",
      "label": "Work",
      "id": "0",
      "isSelectLabel": false
    }
  ],
  "IsInactive": false,
  "Zip": null,
  "State": "",
  "City": null,
  "Address2": null,
  "Address1": null,
  "Title": null,
  "Last_Name": "Jane",
  "First_Name": "Doe",
  "Contact_Type": "158",
  "id": "35809",
  "company": "",
  "Original_Phone": "222-222-2222",
  "Original_Email": "janedoe@wastelinq.com",
  "MContact": 35809,
  "Cust_Contact": 71267
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "Vendor_Number": "",
  "Master_Contact": {
    "Company": "",
    "Phone": "222-222-2222",
    "Email": "janedoe@wastelinq.com",
    "contactTypes": [
      {
        "id": 158,
        "name": "Customer Primary"
      },
      {
        "id": 159,
        "name": "Site Secondary"
      },
      {
        "id": 160,
        "name": "Accounts Payable"
      },
      {
        "id": 161,
        "name": "Site Primary"
      },
      {
        "id": 162,
        "name": "Profile Contact"
      },
      {
        "id": 268,
        "name": "Customer Secondary"
      },
      {
        "id": 598,
        "name": "Refactor"
      }
    ],
    "id": 35809,
    "Contact_Number": 36242,
    "First_Name": "Jane",
    "Last_Name": "Doe",
    "Title": null,
    "Address1": null,
    "Address2": null,
    "City": null,
    "State": "",
    "Zip": null,
    "Status": "Active",
    "Created_date": "2020-06-15T15:14:06.123490-05:00",
    "Modified_date": "2024-08-25T22:26:08.813043-05:00",
    "IsInactive": false,
    "User": 179,
    "Broker": 31
  },
  "Cust_Contact": 71267,
  "Contact_Type": "158"
}

add_contact_with_json

add_contact_with_json
POST/api/tools/contact/add_contact_with_json/{customer_id}/

Overview:

The add_contact_with_json endpoint, accessible at /api/tools/contact/add_contact_with_json/{customer_id}/, is a POST request that is used to add a new contact.

Request Body and Response Description:

Name Data Type Description
success boolean Indicates whether the operation was successful.
Vendor_Number string The vendor number.
Master_Contact object The master contact details.
Company string The company name.
Phone string The phone number.
Email string The email address.
contactTypes array An array of contact types.
id number The unique identifier for the contact type.
name string The name of the contact type.
Contact_Number number The contact number.
First_Name string The first name of the contact.
Last_Name string The last name of the contact.
Title string The title of the contact.
IsInactive boolean Indicates whether the contact is inactive.

Example URI

POST [Contacts APIs](https://test-api.wastelinq.com)./api/tools/contact/add_contact_with_json/customer_id/
URI Parameters
HideShow
customer_id
number (required) 

The customer ID.

Request
HideShow
Headers
Content-Type: application/json
Authorization: {TOKEN}
Body
{
  "Email": [
    {
      "email": "janedoe@wastelinq.com",
      "label": "Work",
      "id": "0",
      "isSelectLabel": false
    }
  ],
  "Phone": [
    {
      "number_ext": null,
      "number": "222-222-2222",
      "label": "Work",
      "id": "0",
      "isSelectLabel": false
    }
  ],
  "IsInactive": false,
  "Zip": null,
  "State": "",
  "City": null,
  "Address2": null,
  "Address1": null,
  "Title": null,
  "Last_Name": "Jane",
  "First_Name": "Doe",
  "Contact_Type": "158",
  "id": "34933",
  "company": "",
  "Original_Phone": "222-222-2222",
  "Original_Email": "janedoe@wastelinq.com",
  "MContact": "34933",
  "Cust_Contact": "",
  "Original_First_Name": "Jane",
  "Original_Last_Name": "Doe"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "Vendor_Number": 10434,
  "Contact_Type": "158",
  "Master_Contact": {
    "Company": "",
    "Phone": "222-222-2222 ",
    "Email": "janedoe@wastelinq.com",
    "contactTypes": [
      {
        "id": 158,
        "name": "Customer Primary"
      },
      {
        "id": 159,
        "name": "Site Secondary"
      },
      {
        "id": 160,
        "name": "Accounts Payable"
      },
      {
        "id": 161,
        "name": "Site Primary"
      },
      {
        "id": 162,
        "name": "Profile Contact"
      },
      {
        "id": 268,
        "name": "Customer Secondary"
      },
      {
        "id": 598,
        "name": "Refactor"
      }
    ],
    "id": 34589,
    "Contact_Number": 35024,
    "First_Name": "Jane",
    "Last_Name": "Doe",
    "Title": null,
    "IsInactive": false
  }
}

Generated by aglio on 29 Aug 2024