Get Available Vendor API
Require Authentication
This API is used to get available vendors for the company based on combination of deviceID and token.
URL
api/projects/vendorlist
Required parameter (POST)
- deviceID
- token
Optional parameter (GET)
All optional parameters use GET method. So it should be embedded in the URL, e.g: api/projects/vendorlist?q=vendor&o=vendorName
- q «contains keyword that want to be looked for. Keyword will search projectName field only»
- o «used to sort data, contains field name. Available value: projectName, total_projectpins, total_projectgroup. Default value: projectName»
- ot «used to sort data, contains sort type. Available value: asc, desc. Default value: asc»
- per_page «indicates how many data that will be displayed in each call. Value must be a number between 1 to 500. Default value: none (unlimited result)»
- offset «indicates the first data index that will be displayed in each call. Value must be a number with minimum value is 0. Default value: 0»
Example JSON Payload
{
"deviceID": "ABCD-EFGH-IJKL-MNOP",
"token": "bb602ab13b8090268cd6e3bb9dfa39e2"
}
Possible return HTTP status code
- 200
- 401
- 405
Return message
{
"status": "success",
"message": {
"current_parameter": "?offset=0",
"next_parameter": "",
"previous_parameter": "",
"start": 0,
"total": 4,
"lists": [
{
"vendorID": "121",
"vendorName": "TIGA",
"vendorStakeholderName": "stake",
"vendorDescription": "",
"vendorLogoURL": null,
"vendorAddress1": null,
"vendorAddress2": null,
"vendorCity": null,
"vendorState": null,
"vendorCountry": null,
"vendorLatitude": null,
"vendorLongitude": null,
"vendorZipCode": null,
"vendorPhone": "",
"healthAndSafetyContact": null,
"vendorFax": null,
"vendorWebsite": null,
"vendorEmail": "",
"vendorCreatedDate": "1605695137",
"vendorModifiedDate": "1606140422",
"status": "active",
"kgPerLitre": "3.00",
"companyID": 16,
"createdByUserID": 198,
"updatedByUserID": 198
},
{
"vendorID": "103",
"vendorName": "vend",
"vendorStakeholderName": "stake",
"vendorDescription": "tes desc",
"vendorLogoURL": "a2fa648b13a078651af45d8d00d1b69c.png",
"vendorAddress1": null,
"vendorAddress2": null,
"vendorCity": null,
"vendorState": null,
"vendorCountry": null,
"vendorLatitude": null,
"vendorLongitude": null,
"vendorZipCode": null,
"vendorPhone": "1123",
"healthAndSafetyContact": null,
"vendorFax": null,
"vendorWebsite": null,
"vendorEmail": "asdac@adsa",
"vendorCreatedDate": "1607520974",
"vendorModifiedDate": "1607520974",
"status": "active",
"kgPerLitre": "1.00",
"companyID": 16,
"createdByUserID": 90,
"updatedByUserID": 90
},
{
"vendorID": "98",
"vendorName": "Vendor test",
"vendorStakeholderName": "stakeholder name",
"vendorDescription": "",
"vendorLogoURL": null,
"vendorAddress1": null,
"vendorAddress2": null,
"vendorCity": null,
"vendorState": null,
"vendorCountry": null,
"vendorLatitude": null,
"vendorLongitude": null,
"vendorZipCode": null,
"vendorPhone": "",
"healthAndSafetyContact": null,
"vendorFax": null,
"vendorWebsite": null,
"vendorEmail": "",
"vendorCreatedDate": "1605695137",
"vendorModifiedDate": "1606140422",
"status": "active",
"kgPerLitre": "1.00",
"companyID": 16,
"createdByUserID": 198,
"updatedByUserID": 198
},
{
"vendorID": "120",
"vendorName": "Vendor TWO",
"vendorStakeholderName": "stakeholder name",
"vendorDescription": "",
"vendorLogoURL": null,
"vendorAddress1": null,
"vendorAddress2": null,
"vendorCity": null,
"vendorState": null,
"vendorCountry": null,
"vendorLatitude": null,
"vendorLongitude": null,
"vendorZipCode": null,
"vendorPhone": "",
"healthAndSafetyContact": null,
"vendorFax": null,
"vendorWebsite": null,
"vendorEmail": "",
"vendorCreatedDate": "1605695137",
"vendorModifiedDate": "1606140422",
"status": "active",
"kgPerLitre": "2.00",
"companyID": 16,
"createdByUserID": 198,
"updatedByUserID": 198
}
]
}
}
Note: use "next_parameter" and "previous_parameter" to go to next or previous result page. Just combine it with the API URL, e.g: "api/projects/vendorlist"+next_parameter or "api/projects/vendorlist"+previous_parameter