Returns a paginated list of brands sorted by id
in descending order.
List All Brands
Header
Authorization String |
Set value to Bearer SECRET_KEY |
limit integer |
Specify how many records you want to retrieve per page. If not specified we use a default value of 50. |
curl -L 'https://api.vendloop.com/brands/' \ -H 'Authorization: Bearer SECRET_KEY'
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://api.vendloop.com/brands', CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array( 'Authorization: Bearer SECRET_KEY' ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
var myHeaders = new Headers(); myHeaders.append("Authorization", "Bearer SECRET_KEY"); var requestOptions = { method: 'GET', headers: myHeaders, redirect: 'follow' }; fetch("https://api.vendloop.com/brands", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));
val client = OkHttpClient() val request = Request.Builder() .url("https://api.vendloop.com/brands") .addHeader("Authorization", "Bearer SECRET_KEY") .build() val response = client.newCall(request).execute()
Sample Response
{ "status":true, "message":"Brand records found", "data":[ { "code":"coke", "id":"2", "image_url":"https://app.vendloop.com/uploads/thumbs/4f5f41c0411628819a127d88fddbbfc0.png", "name":"Coca-Cola" } ], "metadata":{ "limit":50, "start":1, "total":1 } }
{ "status": false, "message": "Brand records not found" }
Fetch a Single Brand
Returns details of a brand with the given ID.
Header
Authorization String |
Set value to Bearer SECRET_KEY |
id required integer |
Auto-generated unique ID |
code string |
Specify the code for this brand. this is ignored if the id parameter is used |
curl -L 'https://api.vendloop.com/brands/{id_or_code}' \ -H 'Authorization: Bearer SECRET_KEY'
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://api.vendloop.com/brands/{id_or_code}', CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array( 'Authorization: Bearer SECRET_KEY' ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
var myHeaders = new Headers(); myHeaders.append("Authorization", "Bearer SECRET_KEY"); var requestOptions = { method: 'GET', headers: myHeaders, redirect: 'follow' }; fetch("https://api.vendloop.com/brands/{id_or_code}", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));
val client = OkHttpClient() val request = Request.Builder() .url("https://api.vendloop.com/brands/{id_or_code}") .addHeader("Authorization", "Bearer SECRET_KEY") .build() val response = client.newCall(request).execute()
Sample Response
{ "status":true, "message":"Brand record found", "data":{ "code":"coke", "id":"2", "image_url":"https://app.vendloop.com/uploads/thumbs/4f5f41c0411628819a127d88fddbbfc0.png", "name":"coca-cola" } }
{ "status": false, "message": "Brand record not found" }
Delete a Single Brand
Delete brand with the given ID.
Header
Authorization String |
Set value to Bearer SECRET_KEY |
id required integer |
The ID of the brand to be deleted. |
curl -L 'http://api.vendloop.com/brands/delete' \ -H 'Authorization: Bearer SECRET_KEY' \ -F 'id="{id}"'
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://api.vendloop.com/brands/delete', CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => array('id' => '{id}'), CURLOPT_HTTPHEADER => array( 'Authorization: Bearer SECRET_KEY' ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
var myHeaders = new Headers(); myHeaders.append("Authorization", "Bearer SECRET_KEY"); var formdata = new FormData(); formdata.append("id", "{id}"); var requestOptions = { method: 'POST', headers: myHeaders, body: formdata, redirect: 'follow' }; fetch("https://api.vendloop.com/brands/delete", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));
val client = OkHttpClient() val mediaType = "text/plain".toMediaType() val body = MultipartBody.Builder().setType(MultipartBody.FORM) .addFormDataPart("id","{id}") .build() val request = Request.Builder() .url("https://api.vendloop.com/brands/delete") .post(body) .addHeader("Authorization", "Bearer SECRET_KEY") .build() val response = client.newCall(request).execute()
Sample Response
{ "status": true, "message": "Brand record deleted" }
{ "status": false, "message": "Brand record not found" }