List All Users

get https://api.vendloop.com/users

Returns a paginated list of users sorted by id in descending order.

Header

Authorization
String
Set value to Bearer SECRET_KEY
active
integer
If included, only active or inactive users will be returned. One of: 0 or 1.
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/users/' \
-H 'Authorization: Bearer SECRET_KEY'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.vendloop.com/users',
  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/users", 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/users")
  .addHeader("Authorization", "Bearer SECRET_KEY")
  .build()
val response = client.newCall(request).execute()

Sample Response

{
  "status":true,
  "message":"User records found",
  "data":[
    {
      "id":"4",
      "created_on":"2021-06-15 00:09:44",
      "first_name":"Rose",
      "last_name":"Ogar",
      "phone":"+23422222",
      "email":"[email protected]",
      "image_url":"https://app.vendloop.com/uploads/avatars/thumbs/0b7a9e5e744dab467b6262ca471e9f4f.jpg",
      "group":"Waiter",
      "active":"1",
      "group_id":"7",
      "store_id":"1",
      "business_id":"1",
      "price_group_id":null,
      "award_points":"65"
    }
  ],
  "metadata":{
    "limit":50,
    "start":1,
    "total":1
  }
}
{
    "status": false,
    "message": "User records not found"
}

Fetch a Single User

get https://api.vendloop.com/users/{id}

Returns details of a user with the given ID.

Header

Authorization
String
Set value to Bearer SECRET_KEY
id required
integer
Auto-generated unique ID
active
integer
If included, only active or inactive users will be returned. One of: 0 or 1.
curl -L 'https://api.vendloop.com/users/{id}' \
-H 'Authorization: Bearer SECRET_KEY'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.vendloop.com/users/{id}',
  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/users/{id}", 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/users/{id}")
  .addHeader("Authorization", "Bearer SECRET_KEY")
  .build()
val response = client.newCall(request).execute()

Sample Response

{
  "status":true,
  "message":"User record found",
  "data":{
    "id":"4",
    "created_on":"2021-06-15 00:09:44",
    "first_name":"Rose",
    "last_name":"Ogar",
    "phone":"+23422222",
    "email":"[email protected]",
    "image_url":"https://app.vendloop.com/uploads/avatars/thumbs/0b7a9e5e744dab467b6262ca471e9f4f.jpg",
    "group":"Waiter",
    "active":"1",
    "group_id":"7",
    "store_id":"1",
    "business_id":"1",
    "price_group_id":null,
    "award_points":"65"
  }
}
{
    "status": false,
    "message": "User record not found"
}

Delete a Single User

post https://api.vendloop.com/users/delete

Delete user with the given ID.

Header

Authorization
String
Set value to Bearer SECRET_KEY
id required
integer
The ID of the user to be deleted.
curl -L 'http://api.vendloop.com/users/delete' \
-H 'Authorization: Bearer SECRET_KEY' \
-F 'id="{id}"'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.vendloop.com/users/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/users/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/users/delete")
  .post(body)
  .addHeader("Authorization", "Bearer SECRET_KEY")
  .build()
val response = client.newCall(request).execute()

Sample Response

{
  "status":true,
  "message":"User record deleted"
}
{
    "status": false,
    "message": "User record not found"
}