NAV
Curl JavaScript PHP Python Ruby Go Java

POP Check API v2.0.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

This is the API specification for POP Check. The API supports logging in an API user, getting, setting and deleting the relevant content for the business like clients, campaigns, sites, surveys, visits, media.

The endpoint is https://api.popcheck.com/v2/

A typical flow is:
1. POST to /login to get a token for the API user
2. GET to /clients to get the list of clients and the client UUIDs
3. GET/POST/PUT/DELETE to the various endpoints to get or change the required data - with the relevant client UUID appended to the URL.

Base URL:

Authentication

Login

The /login endpoint is to manage user tokens. Login and get a token by POSTing with a username and password. You can also validate a token using this endpoint.

Login user

Code samples

# You can also use wget
curl -X POST https://api.popcheck.com/v2/login \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

const inputBody = '{
  "email": "jane@example.com",
  "password": "XXXXXXXX"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('https://api.popcheck.com/v2/login',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://api.popcheck.com/v2/login', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('https://api.popcheck.com/v2/login', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.post 'https://api.popcheck.com/v2/login',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://api.popcheck.com/v2/login", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/login");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /login

Login a user with an email and password. Returns the token, user details, role, business and clients for this user

Body parameter

{
  "email": "jane@example.com",
  "password": "XXXXXXXX"
}

Parameters

Name In Type Required Description
email body string true none
password body string true none

Example responses

200 Response

{
  "token": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "name": "Jane",
  "email": "jane@example.com",
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "Business": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "name": "The Field Marketing Team",
    "imageUrl": "https://s3-eu-west-1.amazonaws.com/popcheck.logos/logo1.png",
    "imageBgColor": 0,
    "canCreateNewClients": true,
    "clientDescriptor": true,
    "webSettings": "{ isRegularMode: true }",
    "clientSettings": "{ maxDaysForPreviousVisits: 30 }",
    "apiKeyGoogle": "abc123"
  },
  "Role": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "canAccessAllClients": true,
    "canUseCMS": true,
    "canManagePayments": true,
    "permissions": "{ \"clients\": [\"post\", \"get\", \"put\", \"delete\"], \"locations\": [\"post\", \"get\"] }"
  },
  "Clients": [
    {
      "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
      "name": "Store survey",
      "defaultLocationRange": 500,
      "canSetStatus": true,
      "canEditEquipment": true,
      "canOrderEquipment": true,
      "canSetCustom": true,
      "locationCustomDefinition": {},
      "photoResolution": "1024x768",
      "isArchived": true,
      "createdAt": "01/01/2023 09:00"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK successful operation Login
401 Unauthorized unauthorised - missing email and/or password or user not found None

Get login status

Code samples

# You can also use wget
curl -X GET https://api.popcheck.com/v2/login \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/login',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.popcheck.com/v2/login', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://api.popcheck.com/v2/login', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://api.popcheck.com/v2/login',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.popcheck.com/v2/login", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/login");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /login

Get the user details based on the bearer token. Can be used for validating a token. Returns the token, user details, role, business and clients for this user.

Example responses

200 Response

[
  {
    "token": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "name": "Jane",
    "email": "jane@example.com",
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "Business": {
      "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
      "name": "The Field Marketing Team",
      "imageUrl": "https://s3-eu-west-1.amazonaws.com/popcheck.logos/logo1.png",
      "imageBgColor": 0,
      "canCreateNewClients": true,
      "clientDescriptor": true,
      "webSettings": "{ isRegularMode: true }",
      "clientSettings": "{ maxDaysForPreviousVisits: 30 }",
      "apiKeyGoogle": "abc123"
    },
    "Role": {
      "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
      "canAccessAllClients": true,
      "canUseCMS": true,
      "canManagePayments": true,
      "permissions": "{ \"clients\": [\"post\", \"get\", \"put\", \"delete\"], \"locations\": [\"post\", \"get\"] }"
    },
    "Clients": [
      {
        "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
        "name": "Store survey",
        "defaultLocationRange": 500,
        "canSetStatus": true,
        "canEditEquipment": true,
        "canOrderEquipment": true,
        "canSetCustom": true,
        "locationCustomDefinition": {},
        "photoResolution": "1024x768",
        "isArchived": true,
        "createdAt": "01/01/2023 09:00"
      }
    ]
  }
]

Responses

Status Meaning Description Schema
200 OK successful operation Inline
401 Unauthorized unauthorised - invalid API token None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Login] false none none
» token string false none The berear token for this user - for making further API requests.
» name string false none User name
» email string false none User email
» uuid string false none A unique UUID for this user
» Business Business false none none
»» uuid string false none A unique UUID for this business
»» name string false none Business name
»» imageUrl string false none The brand image for this business, displayed in the mobile app
»» imageBgColor integer(int32) false none The background color for the image - used to color the background in the mobile app behind the imageUrl image
»» canCreateNewClients boolean false none A flag indicating whether this business allows new clients to be created
»» clientDescriptor string false none The text used to describe clients. Typically 'client' or 'survey' depending on the use-case. Changes the web CMS labelling.
»» webSettings string false none JSON string that contains various web CMS settings for the business that change how the CMS is displayed.
»» clientSettings string false none JSON string that contains various mobile client settings for the business that change how the mobile app displays data.
»» apiKeyGoogle string false none Google Maps API key for this business if the business has provided a paid-for key.
» Role Role false none none
»» uuid string false none A unique UUID for this business
»» canAccessAllClients boolean false none A flag indicating whether this role can access all clients or only specified clients
»» canUseCMS boolean false none A flag indicating whether this role can access the web CMS
»» canManagePayments boolean false none A flag indicating whether this role can manage payments, including viewing invoices
»» permissions string false none A JSON string that describes the API endpoint access for this role
» Clients [Client] false none none
»» uuid string false none A unique UUID for this client
»» name string false none Client name
»» defaultLocationRange integer(int32) false none The default distance in metres to a site location for the location to be viewed as close or far
»» canSetStatus boolean false none A flag indicating whether the client includes a status setting
»» canEditEquipment boolean false none A flag indicating whether this client supports equipment editing
»» canOrderEquipment boolean false none A flag indicating whether this client supports ordering equipment
»» canSetCustom boolean false none A flag indicating whether this client supports custom-defined fields for each site location
»» locationCustomDefinition string false none A JSON string that describes the custom defined field types - only used if canSetCustom is true
»» photoResolution string false none A string defining the photo resolution captured by the mobile app
»» isArchived boolean false none A flag indicating whether this client is archived - using for the web CMS display
»» createdAt string false none The creation date of this client, format DD/MM/YYYY HH:mm

Clients

The /clients endpoint is for managing survey settings such as...

List all clients

Code samples

# You can also use wget
curl -X GET https://api.popcheck.com/v2/clients \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/clients',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.popcheck.com/v2/clients', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://api.popcheck.com/v2/clients', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://api.popcheck.com/v2/clients',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.popcheck.com/v2/clients", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/clients");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /clients

Get all the clients for this business

Example responses

200 Response

[
  {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "name": "Store survey",
    "imageUrl": "https://s3-eu-west-1.amazonaws.com/popcheck.logos/logo1.png",
    "defaultLocationRange": 500,
    "photoResolution": "1024x768",
    "photoNameFormat": "p_l|l-s-q",
    "pdfNameFormat": "v-n",
    "canSetStatus": true,
    "canAddComments": true,
    "canEditEquipment": true,
    "canOrderEquipment": true,
    "canSetCustom": true,
    "locationStatusChoices": "Site closed;Site not found;Manager not available",
    "locationStatusMinSelect": 1,
    "locationStatusMaxSelect": 3,
    "locationCustomDefinition": {},
    "visitEditableSeconds": 3600,
    "isArchived": true,
    "requireGPS": true,
    "requiredLocationProximity": 1000,
    "defaultVisitsView": 0,
    "canSelectPhotoFromAlbum": true,
    "createdAt": "01/01/2023 09:00"
  }
]

Responses

Status Meaning Description Schema
200 OK successful operation Inline
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [ClientWithDetail] false none none
» uuid string false none A unique UUID for this client
» name string false none Client name
» imageUrl string false none The brand image for this client, NOT USED AT PRESENT
» defaultLocationRange integer(int32) false none The default distance in metres to a site location for the location to be viewed as close or far
» photoResolution string false none A string defining the photo resolution captured by the mobile app
» photoNameFormat string false none A string specifying how photos are named. p = photo tag prefix, l = location reference, c = campaign reference, v = visit refrerence, d = visit end date, s = survey section reference, n = survey section name, q = survey question reference, x = survey question.
» pdfNameFormat string false none A string specifying how PDF reports are named. v = visit refrerence, l = location reference, n = location name, c = campaign reference, d = visit end date, u = uuid.
» canSetStatus boolean false none A flag indicating whether the client includes support for setting status
» canAddComments boolean false none A flag indicating whether the client includes support for adding comments
» canEditEquipment boolean false none A flag indicating whether this client supports equipment editing
» canOrderEquipment boolean false none A flag indicating whether this client supports ordering equipment
» canSetCustom boolean false none A flag indicating whether this client supports custom-defined fields for each site location
» locationStatusChoices string false none A semicolon delimited string with the status options
» locationStatusMinSelect integer(int32) false none The minimum number of selections when setting the location status
» locationStatusMaxSelect integer(int32) false none The maximum number of selections when setting the location status
» locationCustomDefinition string false none A JSON string that describes the custom defined field types - only used if canSetCustom is true
» visitEditableSeconds integer(int32) false none The number of seconds a visit is editable in the mobile app. After this time the visit cannot be edited in the app.
» isArchived boolean false none A flag indicating whether this client is archived - using for the web CMS display
» requireGPS boolean false none A flag indicating whether the mobile app must have GPS switched on or not
» requiredLocationProximity integer(int32) false none If requireGPS then an also require the user to be at least this close in metres to the site location
» defaultVisitsView integer(int32) false none An integer defining the initial mobile app view for visits. NOT PRESENTLY USED.
» canSelectPhotoFromAlbum boolean false none A flag indicating whether the mobile user can select visits from the photo album or must use the camera instead
» createdAt string false none The creation date of this client, format DD/MM/YYYY HH:mm

Create a client

Code samples

# You can also use wget
curl -X POST https://api.popcheck.com/v2/clients \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

const inputBody = '{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "name": "Store survey",
  "imageUrl": "https://s3-eu-west-1.amazonaws.com/popcheck.logos/logo1.png",
  "defaultLocationRange": 500,
  "photoResolution": "1024x768",
  "photoNameFormat": "p_l|l-s-q",
  "pdfNameFormat": "v-n",
  "canSetStatus": true,
  "canAddComments": true,
  "canEditEquipment": true,
  "canOrderEquipment": true,
  "canSetCustom": true,
  "locationStatusChoices": "Site closed;Site not found;Manager not available",
  "locationStatusMinSelect": 1,
  "locationStatusMaxSelect": 3,
  "locationCustomDefinition": {},
  "visitEditableSeconds": 3600,
  "isArchived": true,
  "requireGPS": true,
  "requiredLocationProximity": 1000,
  "defaultVisitsView": 0,
  "canSelectPhotoFromAlbum": true,
  "createdAt": "01/01/2023 09:00"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/clients',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://api.popcheck.com/v2/clients', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://api.popcheck.com/v2/clients', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post 'https://api.popcheck.com/v2/clients',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://api.popcheck.com/v2/clients", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/clients");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /clients

Create a new client for this business.

The request body can be left blank and defaults will be used instead. These can then be updated later through a PUT request. Alternatively provide client name and other optional fields to customise the client setup.

Body parameter

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "name": "Store survey",
  "imageUrl": "https://s3-eu-west-1.amazonaws.com/popcheck.logos/logo1.png",
  "defaultLocationRange": 500,
  "photoResolution": "1024x768",
  "photoNameFormat": "p_l|l-s-q",
  "pdfNameFormat": "v-n",
  "canSetStatus": true,
  "canAddComments": true,
  "canEditEquipment": true,
  "canOrderEquipment": true,
  "canSetCustom": true,
  "locationStatusChoices": "Site closed;Site not found;Manager not available",
  "locationStatusMinSelect": 1,
  "locationStatusMaxSelect": 3,
  "locationCustomDefinition": {},
  "visitEditableSeconds": 3600,
  "isArchived": true,
  "requireGPS": true,
  "requiredLocationProximity": 1000,
  "defaultVisitsView": 0,
  "canSelectPhotoFromAlbum": true,
  "createdAt": "01/01/2023 09:00"
}

Parameters

Name In Type Required Description
body body ClientWithDetail false none
uuid body string false A unique UUID for this client
name body string false Client name
imageUrl body string false The brand image for this client, NOT USED AT PRESENT
defaultLocationRange body integer(int32) false The default distance in metres to a site location for the location to be viewed as close or far
photoResolution body string false A string defining the photo resolution captured by the mobile app
photoNameFormat body string false A string specifying how photos are named. p = photo tag prefix, l = location reference, c = campaign reference, v = visit refrerence, d = visit end date, s = survey section reference, n = survey section name, q = survey question reference, x = survey question.
pdfNameFormat body string false A string specifying how PDF reports are named. v = visit refrerence, l = location reference, n = location name, c = campaign reference, d = visit end date, u = uuid.
canSetStatus body boolean false A flag indicating whether the client includes support for setting status
canAddComments body boolean false A flag indicating whether the client includes support for adding comments
canEditEquipment body boolean false A flag indicating whether this client supports equipment editing
canOrderEquipment body boolean false A flag indicating whether this client supports ordering equipment
canSetCustom body boolean false A flag indicating whether this client supports custom-defined fields for each site location
locationStatusChoices body string false A semicolon delimited string with the status options
locationStatusMinSelect body integer(int32) false The minimum number of selections when setting the location status
locationStatusMaxSelect body integer(int32) false The maximum number of selections when setting the location status
locationCustomDefinition body string false A JSON string that describes the custom defined field types - only used if canSetCustom is true
visitEditableSeconds body integer(int32) false The number of seconds a visit is editable in the mobile app. After this time the visit cannot be edited in the app.
isArchived body boolean false A flag indicating whether this client is archived - using for the web CMS display
requireGPS body boolean false A flag indicating whether the mobile app must have GPS switched on or not
requiredLocationProximity body integer(int32) false If requireGPS then an also require the user to be at least this close in metres to the site location
defaultVisitsView body integer(int32) false An integer defining the initial mobile app view for visits. NOT PRESENTLY USED.
canSelectPhotoFromAlbum body boolean false A flag indicating whether the mobile user can select visits from the photo album or must use the camera instead
createdAt body string false The creation date of this client, format DD/MM/YYYY HH:mm

Example responses

200 Response

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
}

Responses

Status Meaning Description Schema
200 OK successful operation UUID
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
422 Unprocessable Entity unprocessable entity - either bad request body or insufficient permissions None

View one client

Code samples

# You can also use wget
curl -X GET https://api.popcheck.com/v2/clients/{clientUUID}: \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/clients/{clientUUID}:',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.popcheck.com/v2/clients/{clientUUID}:', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://api.popcheck.com/v2/clients/{clientUUID}:', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://api.popcheck.com/v2/clients/{clientUUID}:',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.popcheck.com/v2/clients/{clientUUID}:", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/clients/{clientUUID}:");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /clients/{clientUUID}:

Get the details for this client

Parameters

Name In Type Required Description
clientUUID path string true none

Example responses

200 Response

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "name": "Store survey",
  "imageUrl": "https://s3-eu-west-1.amazonaws.com/popcheck.logos/logo1.png",
  "defaultLocationRange": 500,
  "photoResolution": "1024x768",
  "photoNameFormat": "p_l|l-s-q",
  "pdfNameFormat": "v-n",
  "canSetStatus": true,
  "canAddComments": true,
  "canEditEquipment": true,
  "canOrderEquipment": true,
  "canSetCustom": true,
  "locationStatusChoices": "Site closed;Site not found;Manager not available",
  "locationStatusMinSelect": 1,
  "locationStatusMaxSelect": 3,
  "locationCustomDefinition": {},
  "visitEditableSeconds": 3600,
  "isArchived": true,
  "requireGPS": true,
  "requiredLocationProximity": 1000,
  "defaultVisitsView": 0,
  "canSelectPhotoFromAlbum": true,
  "createdAt": "01/01/2023 09:00"
}

Responses

Status Meaning Description Schema
200 OK successful operation ClientWithDetail
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
404 Not Found client not found None

Delete a client

Code samples

# You can also use wget
curl -X DELETE https://api.popcheck.com/v2/clients/{clientUUID}: \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/clients/{clientUUID}:',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','https://api.popcheck.com/v2/clients/{clientUUID}:', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Authorization': 'Bearer {access-token}'
}

r = requests.delete('https://api.popcheck.com/v2/clients/{clientUUID}:', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.delete 'https://api.popcheck.com/v2/clients/{clientUUID}:',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://api.popcheck.com/v2/clients/{clientUUID}:", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/clients/{clientUUID}:");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

DELETE /clients/{clientUUID}:

Delete this client

Parameters

Name In Type Required Description
clientUUID path string true none

Responses

Status Meaning Description Schema
204 No Content successful operation None
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None

Update a client

Code samples

# You can also use wget
curl -X PUT https://api.popcheck.com/v2/clients/{clientUUID} \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {access-token}'

const inputBody = '{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "name": "Store survey",
  "imageUrl": "https://s3-eu-west-1.amazonaws.com/popcheck.logos/logo1.png",
  "defaultLocationRange": 500,
  "photoResolution": "1024x768",
  "photoNameFormat": "p_l|l-s-q",
  "pdfNameFormat": "v-n",
  "canSetStatus": true,
  "canAddComments": true,
  "canEditEquipment": true,
  "canOrderEquipment": true,
  "canSetCustom": true,
  "locationStatusChoices": "Site closed;Site not found;Manager not available",
  "locationStatusMinSelect": 1,
  "locationStatusMaxSelect": 3,
  "locationCustomDefinition": {},
  "visitEditableSeconds": 3600,
  "isArchived": true,
  "requireGPS": true,
  "requiredLocationProximity": 1000,
  "defaultVisitsView": 0,
  "canSelectPhotoFromAlbum": true,
  "createdAt": "01/01/2023 09:00"
}';
const headers = {
  'Content-Type':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/clients/{clientUUID}',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PUT','https://api.popcheck.com/v2/clients/{clientUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.put('https://api.popcheck.com/v2/clients/{clientUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.put 'https://api.popcheck.com/v2/clients/{clientUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "https://api.popcheck.com/v2/clients/{clientUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/clients/{clientUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

PUT /clients/{clientUUID}

Update this client

Body parameter

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "name": "Store survey",
  "imageUrl": "https://s3-eu-west-1.amazonaws.com/popcheck.logos/logo1.png",
  "defaultLocationRange": 500,
  "photoResolution": "1024x768",
  "photoNameFormat": "p_l|l-s-q",
  "pdfNameFormat": "v-n",
  "canSetStatus": true,
  "canAddComments": true,
  "canEditEquipment": true,
  "canOrderEquipment": true,
  "canSetCustom": true,
  "locationStatusChoices": "Site closed;Site not found;Manager not available",
  "locationStatusMinSelect": 1,
  "locationStatusMaxSelect": 3,
  "locationCustomDefinition": {},
  "visitEditableSeconds": 3600,
  "isArchived": true,
  "requireGPS": true,
  "requiredLocationProximity": 1000,
  "defaultVisitsView": 0,
  "canSelectPhotoFromAlbum": true,
  "createdAt": "01/01/2023 09:00"
}

Parameters

Name In Type Required Description
clientUUID path string true none
body body ClientWithDetail false none
uuid body string false A unique UUID for this client
name body string false Client name
imageUrl body string false The brand image for this client, NOT USED AT PRESENT
defaultLocationRange body integer(int32) false The default distance in metres to a site location for the location to be viewed as close or far
photoResolution body string false A string defining the photo resolution captured by the mobile app
photoNameFormat body string false A string specifying how photos are named. p = photo tag prefix, l = location reference, c = campaign reference, v = visit refrerence, d = visit end date, s = survey section reference, n = survey section name, q = survey question reference, x = survey question.
pdfNameFormat body string false A string specifying how PDF reports are named. v = visit refrerence, l = location reference, n = location name, c = campaign reference, d = visit end date, u = uuid.
canSetStatus body boolean false A flag indicating whether the client includes support for setting status
canAddComments body boolean false A flag indicating whether the client includes support for adding comments
canEditEquipment body boolean false A flag indicating whether this client supports equipment editing
canOrderEquipment body boolean false A flag indicating whether this client supports ordering equipment
canSetCustom body boolean false A flag indicating whether this client supports custom-defined fields for each site location
locationStatusChoices body string false A semicolon delimited string with the status options
locationStatusMinSelect body integer(int32) false The minimum number of selections when setting the location status
locationStatusMaxSelect body integer(int32) false The maximum number of selections when setting the location status
locationCustomDefinition body string false A JSON string that describes the custom defined field types - only used if canSetCustom is true
visitEditableSeconds body integer(int32) false The number of seconds a visit is editable in the mobile app. After this time the visit cannot be edited in the app.
isArchived body boolean false A flag indicating whether this client is archived - using for the web CMS display
requireGPS body boolean false A flag indicating whether the mobile app must have GPS switched on or not
requiredLocationProximity body integer(int32) false If requireGPS then an also require the user to be at least this close in metres to the site location
defaultVisitsView body integer(int32) false An integer defining the initial mobile app view for visits. NOT PRESENTLY USED.
canSelectPhotoFromAlbum body boolean false A flag indicating whether the mobile user can select visits from the photo album or must use the camera instead
createdAt body string false The creation date of this client, format DD/MM/YYYY HH:mm

Responses

Status Meaning Description Schema
204 No Content successful operation None
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
404 Not Found client not found None
422 Unprocessable Entity unprocessable entity - bad request body None

Campaigns

The /campaigns endpoint is for managing campaigns. For most surveys there is just 1 campaign created, however more campaigns can be added if helpful.

List all campaigns

Code samples

# You can also use wget
curl -X GET https://api.popcheck.com/v2/campaigns/{clientUUID} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/campaigns/{clientUUID}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.popcheck.com/v2/campaigns/{clientUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://api.popcheck.com/v2/campaigns/{clientUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://api.popcheck.com/v2/campaigns/{clientUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.popcheck.com/v2/campaigns/{clientUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/campaigns/{clientUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /campaigns/{clientUUID}

Get all the campaigns for this client

Parameters

Name In Type Required Description
clientUUID path string true none

Example responses

200 Response

[
  {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "reference": "c1",
    "name": "Store survey - Chiller cabinets",
    "startDate": "01/01/2023 09:00",
    "endDate": "01/02/2023 17:00",
    "documentLinks": "Site Information^https://s3-eu-west-1.amazonaws.com/popcheckapp.clientfiles/7be7c5cd-d4b5-4693-8198-1eb7335fe72f.pdf"
  }
]

Responses

Status Meaning Description Schema
200 OK successful operation Inline
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
404 Not Found client not found None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Campaign] false none none
» uuid string false none A unique UUID for this campaign
» reference string false none Campaign reference
» name string false none Campaign name
» startDate string false none The start date for the campaign, format DD/MM/YYYY HH:mm
» endDate string false none The end date for the campaign, format DD/MM/YYYY HH:mm
» documentLinks string false none Any PDF documents for this campaign, displayed as links in the mobile app. Sent as a ; and ^ delimited string where ; separates documents and ^ splits the document into title and URL.

Create a campaign

Code samples

# You can also use wget
curl -X POST https://api.popcheck.com/v2/campaigns/{clientUUID} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

const inputBody = '{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "reference": "c1",
  "name": "Store survey - Chiller cabinets",
  "startDate": "01/01/2023 09:00",
  "endDate": "01/02/2023 17:00",
  "documentLinks": "Site Information^https://s3-eu-west-1.amazonaws.com/popcheckapp.clientfiles/7be7c5cd-d4b5-4693-8198-1eb7335fe72f.pdf"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/campaigns/{clientUUID}',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://api.popcheck.com/v2/campaigns/{clientUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://api.popcheck.com/v2/campaigns/{clientUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post 'https://api.popcheck.com/v2/campaigns/{clientUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://api.popcheck.com/v2/campaigns/{clientUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/campaigns/{clientUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /campaigns/{clientUUID}

Create a new campaign for this client.

The request body can be left blank and defaults will be used instead. These can then be updated later through a PUT request. Alternatively provide campaign name and other optional fields to customise the campaign setup.

Body parameter

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "reference": "c1",
  "name": "Store survey - Chiller cabinets",
  "startDate": "01/01/2023 09:00",
  "endDate": "01/02/2023 17:00",
  "documentLinks": "Site Information^https://s3-eu-west-1.amazonaws.com/popcheckapp.clientfiles/7be7c5cd-d4b5-4693-8198-1eb7335fe72f.pdf"
}

Parameters

Name In Type Required Description
clientUUID path string true none
body body Campaign false none
uuid body string false A unique UUID for this campaign
reference body string false Campaign reference
name body string false Campaign name
startDate body string false The start date for the campaign, format DD/MM/YYYY HH:mm
endDate body string false The end date for the campaign, format DD/MM/YYYY HH:mm
documentLinks body string false Any PDF documents for this campaign, displayed as links in the mobile app. Sent as a ; and ^ delimited string where ; separates documents and ^ splits the document into title and URL.

Example responses

200 Response

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
}

Responses

Status Meaning Description Schema
200 OK successful operation UUID
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
404 Not Found unprocessable entity - campaign name already in use None

Update a campaign

Code samples

# You can also use wget
curl -X PUT https://api.popcheck.com/v2/campaigns/{campaignUUID} \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {access-token}'

const inputBody = '{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "reference": "c1",
  "name": "Store survey - Chiller cabinets",
  "startDate": "01/01/2023 09:00",
  "endDate": "01/02/2023 17:00",
  "documentLinks": "Site Information^https://s3-eu-west-1.amazonaws.com/popcheckapp.clientfiles/7be7c5cd-d4b5-4693-8198-1eb7335fe72f.pdf"
}';
const headers = {
  'Content-Type':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/campaigns/{campaignUUID}',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PUT','https://api.popcheck.com/v2/campaigns/{campaignUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.put('https://api.popcheck.com/v2/campaigns/{campaignUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.put 'https://api.popcheck.com/v2/campaigns/{campaignUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "https://api.popcheck.com/v2/campaigns/{campaignUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/campaigns/{campaignUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

PUT /campaigns/{campaignUUID}

Update this campaign

Body parameter

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "reference": "c1",
  "name": "Store survey - Chiller cabinets",
  "startDate": "01/01/2023 09:00",
  "endDate": "01/02/2023 17:00",
  "documentLinks": "Site Information^https://s3-eu-west-1.amazonaws.com/popcheckapp.clientfiles/7be7c5cd-d4b5-4693-8198-1eb7335fe72f.pdf"
}

Parameters

Name In Type Required Description
campaignUUID path string true none
body body Campaign false none
uuid body string false A unique UUID for this campaign
reference body string false Campaign reference
name body string false Campaign name
startDate body string false The start date for the campaign, format DD/MM/YYYY HH:mm
endDate body string false The end date for the campaign, format DD/MM/YYYY HH:mm
documentLinks body string false Any PDF documents for this campaign, displayed as links in the mobile app. Sent as a ; and ^ delimited string where ; separates documents and ^ splits the document into title and URL.

Responses

Status Meaning Description Schema
204 No Content successful operation None
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
404 Not Found campaign not found None
422 Unprocessable Entity unprocessable entity - bad request body None

Delete a campaign

Code samples

# You can also use wget
curl -X DELETE https://api.popcheck.com/v2/campaigns/{campaignUUID} \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/campaigns/{campaignUUID}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','https://api.popcheck.com/v2/campaigns/{campaignUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Authorization': 'Bearer {access-token}'
}

r = requests.delete('https://api.popcheck.com/v2/campaigns/{campaignUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.delete 'https://api.popcheck.com/v2/campaigns/{campaignUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://api.popcheck.com/v2/campaigns/{campaignUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/campaigns/{campaignUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

DELETE /campaigns/{campaignUUID}

Delete this campaign

Parameters

Name In Type Required Description
campaignUUID path string true none

Responses

Status Meaning Description Schema
204 No Content successful operation None
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
404 Not Found campaign not found None

Locations

The /locations endpoint is for managing the physical sites that users visit.

List all locations

Code samples

# You can also use wget
curl -X GET https://api.popcheck.com/v2/locations/{clientUUID} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/locations/{clientUUID}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.popcheck.com/v2/locations/{clientUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://api.popcheck.com/v2/locations/{clientUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://api.popcheck.com/v2/locations/{clientUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.popcheck.com/v2/locations/{clientUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/locations/{clientUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /locations/{clientUUID}

Get all the locations for this client

Parameters

Name In Type Required Description
clientUUID path string true none

Example responses

200 Response

[
  {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "reference": "l123",
    "name": "York store",
    "description": "On the corner opposite the bank",
    "lat": 1.2,
    "lng": 57.3,
    "range": 5000,
    "address0": "1 High Street",
    "address1": "Anytown",
    "address2": "My County",
    "postCode": "AA1 1BB",
    "telephoneNumber": "01234 567890",
    "equipment": "Tills^3;Display cabinets^2",
    "equipmentOrderChoices": "Hangers^Till Hangers^Shelf End Hangers;Poster Frames^Large Format^Small Format",
    "notes": "Manager name is Jim",
    "custom": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK successful operation Inline
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
404 Not Found client not found None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Location] false none none
» uuid string false none A unique UUID for this location
» reference string false none Location reference
» name string false none Location name
» description string false none Location descriptive text
» lat number(double) false none Location latitude
» lng number(double) false none Location longitude
» range integer(int32) false none The distance in metres from the location for the mobile user to be considered in range
» address0 string false none FFirst line of the location address
» address1 string false none Second line of the location address
» address2 string false none Third line of the location address
» postCode string false none Location post code
» telephoneNumber string false none Location telephone number
» equipment string false none Delimited string describing the equipment at this location. Please contact us for further details.
» equipmentOrderChoices string false none Delimited string describing the choices available to the mobile user for ordering equipment at this location. Please contact us for further details.
» notes string false none Location-specific notes
» custom string false none Location custom data, used in conjunction with locationCustomDefinition. Please contact us for further details.

Create a location

Code samples

# You can also use wget
curl -X POST https://api.popcheck.com/v2/locations/{clientUUID} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

const inputBody = '{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "reference": "l123",
  "name": "York store",
  "description": "On the corner opposite the bank",
  "lat": 1.2,
  "lng": 57.3,
  "range": 5000,
  "address0": "1 High Street",
  "address1": "Anytown",
  "address2": "My County",
  "postCode": "AA1 1BB",
  "telephoneNumber": "01234 567890",
  "equipment": "Tills^3;Display cabinets^2",
  "equipmentOrderChoices": "Hangers^Till Hangers^Shelf End Hangers;Poster Frames^Large Format^Small Format",
  "notes": "Manager name is Jim",
  "custom": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/locations/{clientUUID}',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://api.popcheck.com/v2/locations/{clientUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://api.popcheck.com/v2/locations/{clientUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post 'https://api.popcheck.com/v2/locations/{clientUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://api.popcheck.com/v2/locations/{clientUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/locations/{clientUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /locations/{clientUUID}

Create a new location for this client. Note that a single location or multiple locations can be sent as an array in the Post body.

Body parameter

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "reference": "l123",
  "name": "York store",
  "description": "On the corner opposite the bank",
  "lat": 1.2,
  "lng": 57.3,
  "range": 5000,
  "address0": "1 High Street",
  "address1": "Anytown",
  "address2": "My County",
  "postCode": "AA1 1BB",
  "telephoneNumber": "01234 567890",
  "equipment": "Tills^3;Display cabinets^2",
  "equipmentOrderChoices": "Hangers^Till Hangers^Shelf End Hangers;Poster Frames^Large Format^Small Format",
  "notes": "Manager name is Jim",
  "custom": "string"
}

Parameters

Name In Type Required Description
clientUUID path string true none
body body Location false none
uuid body string false A unique UUID for this location
reference body string false Location reference
name body string false Location name
description body string false Location descriptive text
lat body number(double) false Location latitude
lng body number(double) false Location longitude
range body integer(int32) false The distance in metres from the location for the mobile user to be considered in range
address0 body string false FFirst line of the location address
address1 body string false Second line of the location address
address2 body string false Third line of the location address
postCode body string false Location post code
telephoneNumber body string false Location telephone number
equipment body string false Delimited string describing the equipment at this location. Please contact us for further details.
equipmentOrderChoices body string false Delimited string describing the choices available to the mobile user for ordering equipment at this location. Please contact us for further details.
notes body string false Location-specific notes
custom body string false Location custom data, used in conjunction with locationCustomDefinition. Please contact us for further details.

Example responses

200 Response

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
}

Responses

Status Meaning Description Schema
200 OK successful operation UUID
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
413 Payload Too Large too many locations None

View one location

Code samples

# You can also use wget
curl -X GET https://api.popcheck.com/v2/locations/{clientUUID}/{locationUUID} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/locations/{clientUUID}/{locationUUID}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.popcheck.com/v2/locations/{clientUUID}/{locationUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://api.popcheck.com/v2/locations/{clientUUID}/{locationUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://api.popcheck.com/v2/locations/{clientUUID}/{locationUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.popcheck.com/v2/locations/{clientUUID}/{locationUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/locations/{clientUUID}/{locationUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /locations/{clientUUID}/{locationUUID}

Get the details for this location

Parameters

Name In Type Required Description
clientUUID path string true none
locationUUID path string true none

Example responses

200 Response

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "reference": "l123",
  "name": "York store",
  "description": "On the corner opposite the bank",
  "lat": 1.2,
  "lng": 57.3,
  "range": 5000,
  "address0": "1 High Street",
  "address1": "Anytown",
  "address2": "My County",
  "postCode": "AA1 1BB",
  "telephoneNumber": "01234 567890",
  "equipment": "Tills^3;Display cabinets^2",
  "equipmentOrderChoices": "Hangers^Till Hangers^Shelf End Hangers;Poster Frames^Large Format^Small Format",
  "notes": "Manager name is Jim",
  "custom": "string"
}

Responses

Status Meaning Description Schema
200 OK successful operation Location
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
404 Not Found client not found None

Update a location

Code samples

# You can also use wget
curl -X PUT https://api.popcheck.com/v2/locations/{locationUUID} \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {access-token}'

const inputBody = '{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "reference": "l123",
  "name": "York store",
  "description": "On the corner opposite the bank",
  "lat": 1.2,
  "lng": 57.3,
  "range": 5000,
  "address0": "1 High Street",
  "address1": "Anytown",
  "address2": "My County",
  "postCode": "AA1 1BB",
  "telephoneNumber": "01234 567890",
  "equipment": "Tills^3;Display cabinets^2",
  "equipmentOrderChoices": "Hangers^Till Hangers^Shelf End Hangers;Poster Frames^Large Format^Small Format",
  "notes": "Manager name is Jim",
  "custom": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/locations/{locationUUID}',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PUT','https://api.popcheck.com/v2/locations/{locationUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.put('https://api.popcheck.com/v2/locations/{locationUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.put 'https://api.popcheck.com/v2/locations/{locationUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "https://api.popcheck.com/v2/locations/{locationUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/locations/{locationUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

PUT /locations/{locationUUID}

Update this location

Body parameter

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "reference": "l123",
  "name": "York store",
  "description": "On the corner opposite the bank",
  "lat": 1.2,
  "lng": 57.3,
  "range": 5000,
  "address0": "1 High Street",
  "address1": "Anytown",
  "address2": "My County",
  "postCode": "AA1 1BB",
  "telephoneNumber": "01234 567890",
  "equipment": "Tills^3;Display cabinets^2",
  "equipmentOrderChoices": "Hangers^Till Hangers^Shelf End Hangers;Poster Frames^Large Format^Small Format",
  "notes": "Manager name is Jim",
  "custom": "string"
}

Parameters

Name In Type Required Description
locationUUID path string true none
body body Location false none
uuid body string false A unique UUID for this location
reference body string false Location reference
name body string false Location name
description body string false Location descriptive text
lat body number(double) false Location latitude
lng body number(double) false Location longitude
range body integer(int32) false The distance in metres from the location for the mobile user to be considered in range
address0 body string false FFirst line of the location address
address1 body string false Second line of the location address
address2 body string false Third line of the location address
postCode body string false Location post code
telephoneNumber body string false Location telephone number
equipment body string false Delimited string describing the equipment at this location. Please contact us for further details.
equipmentOrderChoices body string false Delimited string describing the choices available to the mobile user for ordering equipment at this location. Please contact us for further details.
notes body string false Location-specific notes
custom body string false Location custom data, used in conjunction with locationCustomDefinition. Please contact us for further details.

Responses

Status Meaning Description Schema
204 No Content successful operation None
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
404 Not Found location not found None

Delete a location

Code samples

# You can also use wget
curl -X DELETE https://api.popcheck.com/v2/locations/{locationUUID} \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/locations/{locationUUID}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','https://api.popcheck.com/v2/locations/{locationUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Authorization': 'Bearer {access-token}'
}

r = requests.delete('https://api.popcheck.com/v2/locations/{locationUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.delete 'https://api.popcheck.com/v2/locations/{locationUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://api.popcheck.com/v2/locations/{locationUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/locations/{locationUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

DELETE /locations/{locationUUID}

Delete this location

Parameters

Name In Type Required Description
locationUUID path string true none

Responses

Status Meaning Description Schema
204 No Content successful operation None
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
404 Not Found location not found None

Visits

The /visits endpoint supports defining and managing user visits to locations.

List all visits

Code samples

# You can also use wget
curl -X GET https://api.popcheck.com/v2/visits/{clientUUID} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/visits/{clientUUID}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.popcheck.com/v2/visits/{clientUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://api.popcheck.com/v2/visits/{clientUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://api.popcheck.com/v2/visits/{clientUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.popcheck.com/v2/visits/{clientUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/visits/{clientUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /visits/{clientUUID}

Get all the visits for this client

Parameters

Name In Type Required Description
clientUUID path string true none

Example responses

200 Response

[
  {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "reference": "v1",
    "flagType": 1,
    "flagData": 255,
    "scheduleStartDate": "01/01/2023 09:00",
    "scheduleEndDate": "01/02/2023 17:00",
    "actualStartDate": "01/01/2023 09:00",
    "actualEndDate": "01/02/2023 17:00",
    "Location": {
      "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
      "name": "Potters Bar store",
      "reference": "l1"
    },
    "Campaign": {
      "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
      "name": "POS review",
      "reference": "c1"
    },
    "User": {
      "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
      "name": "Jane Scott"
    }
  }
]

Responses

Status Meaning Description Schema
200 OK successful operation Inline
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
404 Not Found client not found None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Visit] false none none
» uuid string false none A unique UUID for this visit
» reference string false none Visit reference
» flagType integer(int32) false none An optional indicator to add a marker beside this visit in the mobile app to highlight it. Options 1 - info icon, 2 - info icon selected, 3 - clock icon, 4 - clock icon selected, 5 - warning icon, 6 - warning icon selected, 7 - filled circle.
» flagData string false none If flagType is set then flagData can be used to customise the icon color.
» scheduleStartDate string false none The scheduled start date for this visit, format DD/MM/YYYY HH:mm
» scheduleEndDate string false none The scheduled end date for this visit, format DD/MM/YYYY HH:mm
» actualStartDate string false none The actual start date for this visit, format DD/MM/YYYY HH:mm
» actualEndDate string false none The actual end date for this visit, format DD/MM/YYYY HH:mm
» Location object false none none
»» uuid string false none The unique UUID for this location
»» name string false none Location name
»» reference string false none Location reference
» Campaign object false none none
»» uuid string false none The unique UUID for this campaign
»» name string false none Campaign name
»» reference string false none Campaign reference
» User object false none none
»» uuid string false none The unique UUID for this user
»» name string false none User name

Create a visit

Code samples

# You can also use wget
curl -X POST https://api.popcheck.com/v2/visits/{clientUUID} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

const inputBody = '{
  "reference": "v1",
  "flagType": 1,
  "flagData": 255,
  "scheduleStartDate": "01/01/2023 09:00",
  "scheduleEndDate": "01/02/2023 17:00",
  "actualStartDate": "01/01/2023 09:00",
  "actualEndDate": "01/02/2023 17:00",
  "Location": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
  },
  "Campaign": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
  },
  "User": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
  }
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/visits/{clientUUID}',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://api.popcheck.com/v2/visits/{clientUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://api.popcheck.com/v2/visits/{clientUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post 'https://api.popcheck.com/v2/visits/{clientUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://api.popcheck.com/v2/visits/{clientUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/visits/{clientUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /visits/{clientUUID}

Create a new visit. Note that the POST request must include valid Location, Campaign and User uuids. Note also that a single visit or array of visits can be sent to this endpoint.

Body parameter

{
  "reference": "v1",
  "flagType": 1,
  "flagData": 255,
  "scheduleStartDate": "01/01/2023 09:00",
  "scheduleEndDate": "01/02/2023 17:00",
  "actualStartDate": "01/01/2023 09:00",
  "actualEndDate": "01/02/2023 17:00",
  "Location": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
  },
  "Campaign": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
  },
  "User": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
  }
}

Parameters

Name In Type Required Description
clientUUID path string true none
body body VisitNew false none
reference body string false Visit reference
flagType body integer(int32) false An optional indicator to add a marker beside this visit in the mobile app to highlight it. Options 1 - info icon, 2 - info icon selected, 3 - clock icon, 4 - clock icon selected, 5 - warning icon, 6 - warning icon selected, 7 - filled circle.
flagData body string false If flagType is set then flagData can be used to customise the icon color.
scheduleStartDate body string false The scheduled start date for this visit, format DD/MM/YYYY HH:mm
scheduleEndDate body string false The scheduled end date for this visit, format DD/MM/YYYY HH:mm
actualStartDate body string false The actual start date for this visit, format DD/MM/YYYY HH:mm
actualEndDate body string false The actual end date for this visit, format DD/MM/YYYY HH:mm
Location body object false none
» uuid body string false The unique UUID for this location
Campaign body object false none
» uuid body string false The unique UUID for this campaign
User body object false none
» uuid body string false The unique UUID for this user

Example responses

200 Response

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
}

Responses

Status Meaning Description Schema
200 OK successful operation UUID
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request - missing Location, Campaign or User uuid None
413 Payload Too Large too many active visits per user None

Get one visit

Code samples

# You can also use wget
curl -X GET https://api.popcheck.com/v2/visits/{clientUUID}/{visitUUID} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/visits/{clientUUID}/{visitUUID}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.popcheck.com/v2/visits/{clientUUID}/{visitUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://api.popcheck.com/v2/visits/{clientUUID}/{visitUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://api.popcheck.com/v2/visits/{clientUUID}/{visitUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.popcheck.com/v2/visits/{clientUUID}/{visitUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/visits/{clientUUID}/{visitUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /visits/{clientUUID}/{visitUUID}

Get this visit

Parameters

Name In Type Required Description
clientUUID path string true none
visitUUID path string true none

Example responses

200 Response

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "reference": "v1",
  "flagType": 1,
  "flagData": 255,
  "scheduleStartDate": "01/01/2023 09:00",
  "scheduleEndDate": "01/02/2023 17:00",
  "actualStartDate": "01/01/2023 09:00",
  "actualEndDate": "01/02/2023 17:00",
  "startLat": 1.2,
  "startLng": 57.3,
  "startAccuracy": 20,
  "endLat": 1.2,
  "endLng": 57.3,
  "endAccuracy": 20,
  "Location": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "name": "Potters Bar store",
    "reference": "l1",
    "equipment": "Tills^3;Display cabinets^2",
    "equipmentOrderChoices": "Hangers^Till Hangers^Shelf End Hangers;Poster Frames^Large Format^Small Format",
    "custom": "string"
  },
  "Campaign": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "name": "POS review",
    "reference": "c1",
    "Client": {
      "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
      "name": "Superstore1",
      "reference": "client1"
    }
  },
  "User": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "name": "Jane Scott"
  },
  "LocationStatuses": [
    {
      "type": "status",
      "value": "Site closed for refurbishment"
    }
  ],
  "SurveyResponses": [
    {
      "answer": "Store opens on Tuesday",
      "SurveyQuestion": {
        "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
        "reference": "q2",
        "question": "When does the store open?",
        "sortOrder": 4,
        "type": "photo",
        "SurveySection": {
          "reference": "s4",
          "name": "General questions",
          "sortOrder": 2
        }
      }
    }
  ],
  "Photos": [
    {
      "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
      "url": "https://s3-eu-west-1.amazonaws.com/popcheck.photos/2dc92910-d87b-486c-933e-9c8977632cae.png",
      "lat": 1.5,
      "lng": 50.23,
      "accuracy": 25,
      "PhotoTag": {
        "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
        "reference": "p10",
        "name": "Take a photo of the main door",
        "prefix": "o_",
        "sortOrder": 1
      }
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK successful operation VisitWithResults
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
404 Not Found client not found None

Update visits

Code samples

# You can also use wget
curl -X PUT https://api.popcheck.com/v2/visits \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {access-token}'

const inputBody = '[
  {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "reference": "v1",
    "flagType": 1,
    "flagData": 255,
    "scheduleStartDate": "01/01/2023 09:00",
    "scheduleEndDate": "01/02/2023 17:00",
    "actualStartDate": "01/01/2023 09:00",
    "actualEndDate": "01/02/2023 17:00",
    "Location": {
      "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
    },
    "Campaign": {
      "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
    },
    "User": {
      "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
    }
  }
]';
const headers = {
  'Content-Type':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/visits',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PUT','https://api.popcheck.com/v2/visits', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.put('https://api.popcheck.com/v2/visits', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.put 'https://api.popcheck.com/v2/visits',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "https://api.popcheck.com/v2/visits", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/visits");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

PUT /visits

Update visits

Body parameter

[
  {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "reference": "v1",
    "flagType": 1,
    "flagData": 255,
    "scheduleStartDate": "01/01/2023 09:00",
    "scheduleEndDate": "01/02/2023 17:00",
    "actualStartDate": "01/01/2023 09:00",
    "actualEndDate": "01/02/2023 17:00",
    "Location": {
      "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
    },
    "Campaign": {
      "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
    },
    "User": {
      "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
    }
  }
]

Responses

Status Meaning Description Schema
204 No Content successful operation None
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None

Update a visit

Code samples

# You can also use wget
curl -X PUT https://api.popcheck.com/v2/visits/{visitUUID} \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {access-token}'

const inputBody = '{
  "reference": "v1",
  "flagType": 1,
  "flagData": 255,
  "scheduleStartDate": "01/01/2023 09:00",
  "scheduleEndDate": "01/02/2023 17:00",
  "actualStartDate": "01/01/2023 09:00",
  "actualEndDate": "01/02/2023 17:00",
  "Location": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
  },
  "Campaign": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
  },
  "User": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
  }
}';
const headers = {
  'Content-Type':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/visits/{visitUUID}',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PUT','https://api.popcheck.com/v2/visits/{visitUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.put('https://api.popcheck.com/v2/visits/{visitUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.put 'https://api.popcheck.com/v2/visits/{visitUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "https://api.popcheck.com/v2/visits/{visitUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/visits/{visitUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

PUT /visits/{visitUUID}

Update this visit

Body parameter

{
  "reference": "v1",
  "flagType": 1,
  "flagData": 255,
  "scheduleStartDate": "01/01/2023 09:00",
  "scheduleEndDate": "01/02/2023 17:00",
  "actualStartDate": "01/01/2023 09:00",
  "actualEndDate": "01/02/2023 17:00",
  "Location": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
  },
  "Campaign": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
  },
  "User": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
  }
}

Parameters

Name In Type Required Description
visitUUID path string true none
body body VisitNew false none
reference body string false Visit reference
flagType body integer(int32) false An optional indicator to add a marker beside this visit in the mobile app to highlight it. Options 1 - info icon, 2 - info icon selected, 3 - clock icon, 4 - clock icon selected, 5 - warning icon, 6 - warning icon selected, 7 - filled circle.
flagData body string false If flagType is set then flagData can be used to customise the icon color.
scheduleStartDate body string false The scheduled start date for this visit, format DD/MM/YYYY HH:mm
scheduleEndDate body string false The scheduled end date for this visit, format DD/MM/YYYY HH:mm
actualStartDate body string false The actual start date for this visit, format DD/MM/YYYY HH:mm
actualEndDate body string false The actual end date for this visit, format DD/MM/YYYY HH:mm
Location body object false none
» uuid body string false The unique UUID for this location
Campaign body object false none
» uuid body string false The unique UUID for this campaign
User body object false none
» uuid body string false The unique UUID for this user

Responses

Status Meaning Description Schema
204 No Content successful operation None
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None

Delete a visit

Code samples

# You can also use wget
curl -X DELETE https://api.popcheck.com/v2/visits/{visitUUID} \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/visits/{visitUUID}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','https://api.popcheck.com/v2/visits/{visitUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Authorization': 'Bearer {access-token}'
}

r = requests.delete('https://api.popcheck.com/v2/visits/{visitUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.delete 'https://api.popcheck.com/v2/visits/{visitUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://api.popcheck.com/v2/visits/{visitUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/visits/{visitUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

DELETE /visits/{visitUUID}

Delete this visit

Parameters

Name In Type Required Description
visitUUID path string true none

Responses

Status Meaning Description Schema
204 No Content successful operation None
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
404 Not Found visit not found None

Reset a visit

Code samples

# You can also use wget
curl -X PUT https://api.popcheck.com/v2/visits/{visitUUID}/actions/reset \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/visits/{visitUUID}/actions/reset',
{
  method: 'PUT',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PUT','https://api.popcheck.com/v2/visits/{visitUUID}/actions/reset', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Authorization': 'Bearer {access-token}'
}

r = requests.put('https://api.popcheck.com/v2/visits/{visitUUID}/actions/reset', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.put 'https://api.popcheck.com/v2/visits/{visitUUID}/actions/reset',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "https://api.popcheck.com/v2/visits/{visitUUID}/actions/reset", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/visits/{visitUUID}/actions/reset");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

PUT /visits/{visitUUID}/actions/reset

Reset this visit. Clears the actualStartDate, actualEndDate and other visit fields to make the visit available for mobile clients to complete.

Parameters

Name In Type Required Description
visitUUID path string true none

Responses

Status Meaning Description Schema
204 No Content successful operation None
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None

Media

The /media endpoint is for getting media like photos and videos.

List all media

Code samples

# You can also use wget
curl -X GET https://api.popcheck.com/v2/media/{clientUUID} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/media/{clientUUID}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.popcheck.com/v2/media/{clientUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://api.popcheck.com/v2/media/{clientUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://api.popcheck.com/v2/media/{clientUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.popcheck.com/v2/media/{clientUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/media/{clientUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /media/{clientUUID}

Get all the media for this client

Parameters

Name In Type Required Description
clientUUID path string true none

Example responses

200 Response

[
  {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "url": "https://s3-eu-west-1.amazonaws.com/popcheck.photos/2dc92910-d87b-486c-933e-9c8977632cae.png"
  }
]

Responses

Status Meaning Description Schema
200 OK successful operation Inline
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Medium] false none none
» uuid string false none A unique UUID for this media item
» url string false none The url of this media item

Photo Tags

The /phototags endpoint supports defining overview photos for the survey.

List all overview photos

Code samples

# You can also use wget
curl -X GET https://api.popcheck.com/v2/phototags/{clientUUID} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/phototags/{clientUUID}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.popcheck.com/v2/phototags/{clientUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://api.popcheck.com/v2/phototags/{clientUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://api.popcheck.com/v2/phototags/{clientUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.popcheck.com/v2/phototags/{clientUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/phototags/{clientUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /phototags/{clientUUID}

Get all the overview photos for this client

Parameters

Name In Type Required Description
clientUUID path string true none

Example responses

200 Response

[
  {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "name": "Front door photo",
    "orientation": "landscape",
    "prefix": "fd_",
    "isRequired": true,
    "sortOrder": 3
  }
]

Responses

Status Meaning Description Schema
200 OK successful operation Inline
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
404 Not Found client not found None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [PhotoTag] false none none
» uuid string false none A unique UUID for this overview photo
» name string false none Photo name
» orientation string false none The orientation of the photo, one of portrait, landscape or any
» prefix string false none A prefix for this overview photo - used to help with photo naming
» isRequired boolean false none A flag indicating whether this overview photo is required
» sortOrder integer(int32) false none The sort order for this overview photo, starting from 0

Enumerated Values

Property Value
orientation portrait
orientation landscape
orientation any

Create an overview photo

Code samples

# You can also use wget
curl -X POST https://api.popcheck.com/v2/phototags/{clientUUID} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

const inputBody = '{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "name": "Front door photo",
  "orientation": "landscape",
  "prefix": "fd_",
  "isRequired": true,
  "sortOrder": 3
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/phototags/{clientUUID}',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://api.popcheck.com/v2/phototags/{clientUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://api.popcheck.com/v2/phototags/{clientUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post 'https://api.popcheck.com/v2/phototags/{clientUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://api.popcheck.com/v2/phototags/{clientUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/phototags/{clientUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /phototags/{clientUUID}

Create a new overview photo for this client

Body parameter

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "name": "Front door photo",
  "orientation": "landscape",
  "prefix": "fd_",
  "isRequired": true,
  "sortOrder": 3
}

Parameters

Name In Type Required Description
clientUUID path string true none
body body PhotoTag false none
uuid body string false A unique UUID for this overview photo
name body string false Photo name
orientation body string false The orientation of the photo, one of portrait, landscape or any
prefix body string false A prefix for this overview photo - used to help with photo naming
isRequired body boolean false A flag indicating whether this overview photo is required
sortOrder body integer(int32) false The sort order for this overview photo, starting from 0

Enumerated Values

Parameter Value
orientation portrait
orientation landscape
orientation any

Example responses

200 Response

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
}

Responses

Status Meaning Description Schema
200 OK successful operation UUID
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
404 Not Found client uuid not found None

Update an overview photo

Code samples

# You can also use wget
curl -X PUT https://api.popcheck.com/v2/phototags/{phototagUUID} \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {access-token}'

const inputBody = '{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "name": "Front door photo",
  "orientation": "landscape",
  "prefix": "fd_",
  "isRequired": true,
  "sortOrder": 3
}';
const headers = {
  'Content-Type':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/phototags/{phototagUUID}',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PUT','https://api.popcheck.com/v2/phototags/{phototagUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.put('https://api.popcheck.com/v2/phototags/{phototagUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.put 'https://api.popcheck.com/v2/phototags/{phototagUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "https://api.popcheck.com/v2/phototags/{phototagUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/phototags/{phototagUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

PUT /phototags/{phototagUUID}

Update this overview photo

Body parameter

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "name": "Front door photo",
  "orientation": "landscape",
  "prefix": "fd_",
  "isRequired": true,
  "sortOrder": 3
}

Parameters

Name In Type Required Description
phototagUUID path string true none
body body PhotoTag false none
uuid body string false A unique UUID for this overview photo
name body string false Photo name
orientation body string false The orientation of the photo, one of portrait, landscape or any
prefix body string false A prefix for this overview photo - used to help with photo naming
isRequired body boolean false A flag indicating whether this overview photo is required
sortOrder body integer(int32) false The sort order for this overview photo, starting from 0

Enumerated Values

Parameter Value
orientation portrait
orientation landscape
orientation any

Responses

Status Meaning Description Schema
204 No Content successful operation None
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
404 Not Found photo tag not found None

Delete an overview photo

Code samples

# You can also use wget
curl -X DELETE https://api.popcheck.com/v2/phototags/{phototagUUID} \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/phototags/{phototagUUID}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','https://api.popcheck.com/v2/phototags/{phototagUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Authorization': 'Bearer {access-token}'
}

r = requests.delete('https://api.popcheck.com/v2/phototags/{phototagUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.delete 'https://api.popcheck.com/v2/phototags/{phototagUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://api.popcheck.com/v2/phototags/{phototagUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/phototags/{phototagUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

DELETE /phototags/{phototagUUID}

Delete this overview photo

Parameters

Name In Type Required Description
phototagUUID path string true none

Responses

Status Meaning Description Schema
204 No Content successful operation None
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
404 Not Found photo tag not found None

Survey Sections

The /surveysections endpoint enables defining survey sections and questions.

List all survey sections

Code samples

# You can also use wget
curl -X GET https://api.popcheck.com/v2/surveysections/{clientUUID} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/surveysections/{clientUUID}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.popcheck.com/v2/surveysections/{clientUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://api.popcheck.com/v2/surveysections/{clientUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://api.popcheck.com/v2/surveysections/{clientUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.popcheck.com/v2/surveysections/{clientUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/surveysections/{clientUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /surveysections/{clientUUID}

Get all the survey sections and questions for this client

Parameters

Name In Type Required Description
clientUUID path string true none

Example responses

200 Response

[
  {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "reference": "s1",
    "name": "Chiller 1",
    "startDate": "01/01/2023 09:00",
    "endDate": "01/02/2023 17:00",
    "sortOrder": 1,
    "conditionQuestion": "q1",
    "condition": "=",
    "conditionValue": "yes",
    "SurveyQuestions": [
      {
        "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
        "reference": "q100",
        "question": "What is the make of the chiller?",
        "sortOrder": 1,
        "type": "signature",
        "choices": "Samsung;LG;Other",
        "minSelect": 1,
        "maxSelect": 3,
        "isRequired": true,
        "conditionQuestion": "q1",
        "condition": "=",
        "conditionValue": "yes"
      }
    ]
  }
]

Responses

Status Meaning Description Schema
200 OK successful operation Inline
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
404 Not Found client not found None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [SurveySection] false none none
» uuid string false none A unique UUID for this survey section
» reference string false none Survey section reference
» name string false none Survey section name
» startDate string false none The start date for the survey section availability, format DD/MM/YYYY HH:mm
» endDate string false none The end date for the survey section availability, format DD/MM/YYYY HH:mm
» sortOrder integer(int32) false none The sort order for this survey section, starting from 0
» conditionQuestion string false none The condition question reference (if any) for displaying this survey section
» condition string false none The condition type (if any) for the comparison. One of '<', '<=', '=', '>', '>=', '<>', 'includes' or 'any'
» conditionValue string false none The condition value that is compared with the conditionQuestion value using the condition operator
» SurveyQuestions [SurveyQuestion] false none none
»» uuid string false none A unique UUID for this survey question
»» reference string false none Survey question reference
»» question string false none The survey question
»» sortOrder integer(int32) false none The sort order for this survey section, starting from 0
»» type string false none The question type - like multiselect, text or photo
»» choices string false none The choices for this question. Available choices depend on the type. For 'multiselect', choices lists the choices available, separated by a ';'. For 'photo', choices sets the photo orientation to one of portrait, landscape or any. For 'video', choices sets the maximum video duration in seconds.
»» minSelect integer(int32) false none For 'multiselect' this is used to set the minimum number of selections that can be made.
»» maxSelect integer(int32) false none For 'multiselect' this is used to set the maximum number of selections that can be made.
»» isRequired boolean false none A flag indicating whether this survey question must be completed
»» conditionQuestion string false none The condition question reference (if any) for displaying this survey question
»» condition string false none The condition type (if any) for the comparison. One of '<', '<=', '=', '>', '>=', '<>', 'includes' or 'any'
»» conditionValue string false none The condition value that is compared with the conditionQuestion value using the condition operator

Enumerated Values

Property Value
type multiselect
type text
type number
type date
type time
type dateTime
type signature
type barcode
type photo
type qrcode
type video

Create a survey section

Code samples

# You can also use wget
curl -X POST https://api.popcheck.com/v2/surveysections/{clientUUID} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

const inputBody = '{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "reference": "s1",
  "name": "Chiller 1",
  "startDate": "01/01/2023 09:00",
  "endDate": "01/02/2023 17:00",
  "sortOrder": 1,
  "conditionQuestion": "q1",
  "condition": "=",
  "conditionValue": "yes",
  "SurveyQuestions": [
    {
      "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
      "reference": "q100",
      "question": "What is the make of the chiller?",
      "sortOrder": 1,
      "type": "signature",
      "choices": "Samsung;LG;Other",
      "minSelect": 1,
      "maxSelect": 3,
      "isRequired": true,
      "conditionQuestion": "q1",
      "condition": "=",
      "conditionValue": "yes"
    }
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/surveysections/{clientUUID}',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://api.popcheck.com/v2/surveysections/{clientUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://api.popcheck.com/v2/surveysections/{clientUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post 'https://api.popcheck.com/v2/surveysections/{clientUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://api.popcheck.com/v2/surveysections/{clientUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/surveysections/{clientUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /surveysections/{clientUUID}

Create a new survey section with questions for this client. Note that an array of survey sections can also be POST-ed.

Body parameter

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "reference": "s1",
  "name": "Chiller 1",
  "startDate": "01/01/2023 09:00",
  "endDate": "01/02/2023 17:00",
  "sortOrder": 1,
  "conditionQuestion": "q1",
  "condition": "=",
  "conditionValue": "yes",
  "SurveyQuestions": [
    {
      "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
      "reference": "q100",
      "question": "What is the make of the chiller?",
      "sortOrder": 1,
      "type": "signature",
      "choices": "Samsung;LG;Other",
      "minSelect": 1,
      "maxSelect": 3,
      "isRequired": true,
      "conditionQuestion": "q1",
      "condition": "=",
      "conditionValue": "yes"
    }
  ]
}

Parameters

Name In Type Required Description
clientUUID path string true none
body body SurveySection false none
uuid body string false A unique UUID for this survey section
reference body string false Survey section reference
name body string false Survey section name
startDate body string false The start date for the survey section availability, format DD/MM/YYYY HH:mm
endDate body string false The end date for the survey section availability, format DD/MM/YYYY HH:mm
sortOrder body integer(int32) false The sort order for this survey section, starting from 0
conditionQuestion body string false The condition question reference (if any) for displaying this survey section
condition body string false The condition type (if any) for the comparison. One of '<', '<=', '=', '>', '>=', '<>', 'includes' or 'any'
conditionValue body string false The condition value that is compared with the conditionQuestion value using the condition operator
SurveyQuestions body [SurveyQuestion] false none
» uuid body string false A unique UUID for this survey question
» reference body string false Survey question reference
» question body string false The survey question
» sortOrder body integer(int32) false The sort order for this survey section, starting from 0
» type body string false The question type - like multiselect, text or photo
» choices body string false The choices for this question. Available choices depend on the type. For 'multiselect', choices lists the choices available, separated by a ';'. For 'photo', choices sets the photo orientation to one of portrait, landscape or any. For 'video', choices sets the maximum video duration in seconds.
» minSelect body integer(int32) false For 'multiselect' this is used to set the minimum number of selections that can be made.
» maxSelect body integer(int32) false For 'multiselect' this is used to set the maximum number of selections that can be made.
» isRequired body boolean false A flag indicating whether this survey question must be completed
» conditionQuestion body string false The condition question reference (if any) for displaying this survey question
» condition body string false The condition type (if any) for the comparison. One of '<', '<=', '=', '>', '>=', '<>', 'includes' or 'any'
» conditionValue body string false The condition value that is compared with the conditionQuestion value using the condition operator

Enumerated Values

Parameter Value
» type multiselect
» type text
» type number
» type date
» type time
» type dateTime
» type signature
» type barcode
» type photo
» type qrcode
» type video

Example responses

200 Response

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
}

Responses

Status Meaning Description Schema
200 OK successful operation UUID
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
413 Payload Too Large too many survey questions None

Update a survey section

Code samples

# You can also use wget
curl -X PUT https://api.popcheck.com/v2/surveysections/{surveySectionUUID} \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {access-token}'

const inputBody = '{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "reference": "s1",
  "name": "Chiller 1",
  "startDate": "01/01/2023 09:00",
  "endDate": "01/02/2023 17:00",
  "sortOrder": 1,
  "conditionQuestion": "q1",
  "condition": "=",
  "conditionValue": "yes",
  "SurveyQuestions": [
    {
      "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
      "reference": "q100",
      "question": "What is the make of the chiller?",
      "sortOrder": 1,
      "type": "signature",
      "choices": "Samsung;LG;Other",
      "minSelect": 1,
      "maxSelect": 3,
      "isRequired": true,
      "conditionQuestion": "q1",
      "condition": "=",
      "conditionValue": "yes"
    }
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/surveysections/{surveySectionUUID}',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PUT','https://api.popcheck.com/v2/surveysections/{surveySectionUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.put('https://api.popcheck.com/v2/surveysections/{surveySectionUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.put 'https://api.popcheck.com/v2/surveysections/{surveySectionUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "https://api.popcheck.com/v2/surveysections/{surveySectionUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/surveysections/{surveySectionUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

PUT /surveysections/{surveySectionUUID}

Update this survey section and questions

Body parameter

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "reference": "s1",
  "name": "Chiller 1",
  "startDate": "01/01/2023 09:00",
  "endDate": "01/02/2023 17:00",
  "sortOrder": 1,
  "conditionQuestion": "q1",
  "condition": "=",
  "conditionValue": "yes",
  "SurveyQuestions": [
    {
      "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
      "reference": "q100",
      "question": "What is the make of the chiller?",
      "sortOrder": 1,
      "type": "signature",
      "choices": "Samsung;LG;Other",
      "minSelect": 1,
      "maxSelect": 3,
      "isRequired": true,
      "conditionQuestion": "q1",
      "condition": "=",
      "conditionValue": "yes"
    }
  ]
}

Parameters

Name In Type Required Description
surveySectionUUID path string true none
body body SurveySection false none
uuid body string false A unique UUID for this survey section
reference body string false Survey section reference
name body string false Survey section name
startDate body string false The start date for the survey section availability, format DD/MM/YYYY HH:mm
endDate body string false The end date for the survey section availability, format DD/MM/YYYY HH:mm
sortOrder body integer(int32) false The sort order for this survey section, starting from 0
conditionQuestion body string false The condition question reference (if any) for displaying this survey section
condition body string false The condition type (if any) for the comparison. One of '<', '<=', '=', '>', '>=', '<>', 'includes' or 'any'
conditionValue body string false The condition value that is compared with the conditionQuestion value using the condition operator
SurveyQuestions body [SurveyQuestion] false none
» uuid body string false A unique UUID for this survey question
» reference body string false Survey question reference
» question body string false The survey question
» sortOrder body integer(int32) false The sort order for this survey section, starting from 0
» type body string false The question type - like multiselect, text or photo
» choices body string false The choices for this question. Available choices depend on the type. For 'multiselect', choices lists the choices available, separated by a ';'. For 'photo', choices sets the photo orientation to one of portrait, landscape or any. For 'video', choices sets the maximum video duration in seconds.
» minSelect body integer(int32) false For 'multiselect' this is used to set the minimum number of selections that can be made.
» maxSelect body integer(int32) false For 'multiselect' this is used to set the maximum number of selections that can be made.
» isRequired body boolean false A flag indicating whether this survey question must be completed
» conditionQuestion body string false The condition question reference (if any) for displaying this survey question
» condition body string false The condition type (if any) for the comparison. One of '<', '<=', '=', '>', '>=', '<>', 'includes' or 'any'
» conditionValue body string false The condition value that is compared with the conditionQuestion value using the condition operator

Enumerated Values

Parameter Value
» type multiselect
» type text
» type number
» type date
» type time
» type dateTime
» type signature
» type barcode
» type photo
» type qrcode
» type video

Responses

Status Meaning Description Schema
204 No Content successful operation None
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
413 Payload Too Large too many survey questions None

Delete a survey section

Code samples

# You can also use wget
curl -X DELETE https://api.popcheck.com/v2/surveysections/{surveySectionUUID} \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/surveysections/{surveySectionUUID}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','https://api.popcheck.com/v2/surveysections/{surveySectionUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Authorization': 'Bearer {access-token}'
}

r = requests.delete('https://api.popcheck.com/v2/surveysections/{surveySectionUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.delete 'https://api.popcheck.com/v2/surveysections/{surveySectionUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://api.popcheck.com/v2/surveysections/{surveySectionUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/surveysections/{surveySectionUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

DELETE /surveysections/{surveySectionUUID}

Delete this survey section

Parameters

Name In Type Required Description
surveySectionUUID path string true none

Responses

Status Meaning Description Schema
204 No Content successful operation None
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
404 Not Found survey section not found None

Users

The /users endpoint is to support user management.

List all users

Code samples

# You can also use wget
curl -X GET https://api.popcheck.com/v2/users \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/users',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.popcheck.com/v2/users', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://api.popcheck.com/v2/users', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://api.popcheck.com/v2/users',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.popcheck.com/v2/users", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/users");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /users

Get all the users for this business

Example responses

200 Response

[
  {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "name": "Janet",
    "email": "janet@example.com",
    "Role": {
      "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
      "name": "Mobile user",
      "canAccessAllClients": true
    }
  }
]

Responses

Status Meaning Description Schema
200 OK successful operation Inline
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
404 Not Found client not found None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [User] false none none
» uuid string false none A unique UUID for this user
» name string false none User name
» email string false none User email
» Role object false none none
»» uuid string false none A unique UUID for this business
»» name string false none The name of this role
»» canAccessAllClients boolean false none A flag indicating whether this role can access all clients or only specified clients

Create a user

Code samples

# You can also use wget
curl -X POST https://api.popcheck.com/v2/users \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

const inputBody = '{
  "name": "Janet",
  "email": "janet@example.com",
  "roleUUID": "2dc92910-d87b-486c-933e-9c8977636c9e"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/users',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://api.popcheck.com/v2/users', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://api.popcheck.com/v2/users', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post 'https://api.popcheck.com/v2/users',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://api.popcheck.com/v2/users", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/users");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /users

Create a new user. Note - can also POST array of users to create.

Body parameter

{
  "name": "Janet",
  "email": "janet@example.com",
  "roleUUID": "2dc92910-d87b-486c-933e-9c8977636c9e"
}

Parameters

Name In Type Required Description
body body UserNew false none
name body string false User name
email body string false User email
roleUUID body string false The role UUID for the new user

Example responses

200 Response

{
  "uuids": [
    "2dc92910-d87b-486c-933e-9c8977636c9e"
  ]
}

Responses

Status Meaning Description Schema
200 OK successful operation UUIDs
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
404 Not Found unprocessable entity - campaign name already in use None
409 Conflict email already in use None

List all client users

Code samples

# You can also use wget
curl -X GET https://api.popcheck.com/v2/users/{clientUUID} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/users/{clientUUID}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.popcheck.com/v2/users/{clientUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://api.popcheck.com/v2/users/{clientUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://api.popcheck.com/v2/users/{clientUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.popcheck.com/v2/users/{clientUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/users/{clientUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /users/{clientUUID}

Get all the users for this client

Parameters

Name In Type Required Description
clientUUID path string true none

Example responses

200 Response

[
  {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "name": "Janet",
    "email": "janet@example.com",
    "Role": {
      "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
      "name": "Mobile user",
      "canAccessAllClients": true
    }
  }
]

Responses

Status Meaning Description Schema
200 OK successful operation Inline
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
404 Not Found client not found None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [User] false none none
» uuid string false none A unique UUID for this user
» name string false none User name
» email string false none User email
» Role object false none none
»» uuid string false none A unique UUID for this business
»» name string false none The name of this role
»» canAccessAllClients boolean false none A flag indicating whether this role can access all clients or only specified clients

Update a user

Code samples

# You can also use wget
curl -X PUT https://api.popcheck.com/v2/users/{userUUID} \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {access-token}'

const inputBody = '{
  "name": "Janet",
  "email": "janet@example.com",
  "roleUUID": "2dc92910-d87b-486c-933e-9c8977636c9e"
}';
const headers = {
  'Content-Type':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/users/{userUUID}',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PUT','https://api.popcheck.com/v2/users/{userUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.put('https://api.popcheck.com/v2/users/{userUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.put 'https://api.popcheck.com/v2/users/{userUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "https://api.popcheck.com/v2/users/{userUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/users/{userUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

PUT /users/{userUUID}

Update this user

Body parameter

{
  "name": "Janet",
  "email": "janet@example.com",
  "roleUUID": "2dc92910-d87b-486c-933e-9c8977636c9e"
}

Parameters

Name In Type Required Description
userUUID path string true none
body body UserNew false none
name body string false User name
email body string false User email
roleUUID body string false The role UUID for the new user

Responses

Status Meaning Description Schema
204 No Content successful operation None
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
422 Unprocessable Entity unprocessable entity - bad request body None

Delete a user

Code samples

# You can also use wget
curl -X DELETE https://api.popcheck.com/v2/users/{userUUID} \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/users/{userUUID}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','https://api.popcheck.com/v2/users/{userUUID}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Authorization': 'Bearer {access-token}'
}

r = requests.delete('https://api.popcheck.com/v2/users/{userUUID}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.delete 'https://api.popcheck.com/v2/users/{userUUID}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://api.popcheck.com/v2/users/{userUUID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/users/{userUUID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

DELETE /users/{userUUID}

Delete this user

Parameters

Name In Type Required Description
userUUID path string true none

Responses

Status Meaning Description Schema
204 No Content successful operation None
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None
404 Not Found user not found None

Roles

The /roles endpoint is to get a list of all roles.

List all roles

Code samples

# You can also use wget
curl -X GET https://api.popcheck.com/v2/roles \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/roles',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.popcheck.com/v2/roles', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://api.popcheck.com/v2/roles', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://api.popcheck.com/v2/roles',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.popcheck.com/v2/roles", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

URL obj = new URL("https://api.popcheck.com/v2/roles");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /roles

Get all the roles

Example responses

200 Response

[
  {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "name": "Mobile user",
    "description": "Mobile client role",
    "canAccessAllClients": true,
    "canCompleteVisits": true
  }
]

Responses

Status Meaning Description Schema
200 OK successful operation Inline
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - API token does not allow this request None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [RoleCore] false none none
» uuid string false none A unique UUID for this role
» name string false none Role name
» description string false none Role description
» canAccessAllClients boolean false none A flag indicating whether this role can access all clients or only specified clients
» canCompleteVisits boolean false none A flag indicating whether this role can complete visits with the mobile app

Schemas

Login

{
  "token": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "name": "Jane",
  "email": "jane@example.com",
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "Business": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "name": "The Field Marketing Team",
    "imageUrl": "https://s3-eu-west-1.amazonaws.com/popcheck.logos/logo1.png",
    "imageBgColor": 0,
    "canCreateNewClients": true,
    "clientDescriptor": true,
    "webSettings": "{ isRegularMode: true }",
    "clientSettings": "{ maxDaysForPreviousVisits: 30 }",
    "apiKeyGoogle": "abc123"
  },
  "Role": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "canAccessAllClients": true,
    "canUseCMS": true,
    "canManagePayments": true,
    "permissions": "{ \"clients\": [\"post\", \"get\", \"put\", \"delete\"], \"locations\": [\"post\", \"get\"] }"
  },
  "Clients": [
    {
      "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
      "name": "Store survey",
      "defaultLocationRange": 500,
      "canSetStatus": true,
      "canEditEquipment": true,
      "canOrderEquipment": true,
      "canSetCustom": true,
      "locationCustomDefinition": {},
      "photoResolution": "1024x768",
      "isArchived": true,
      "createdAt": "01/01/2023 09:00"
    }
  ]
}

Properties

Name Type Required Restrictions Description
token string false none The berear token for this user - for making further API requests.
name string false none User name
email string false none User email
uuid string false none A unique UUID for this user
Business Business false none none
Role Role false none none
Clients [Client] false none none

Business

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "name": "The Field Marketing Team",
  "imageUrl": "https://s3-eu-west-1.amazonaws.com/popcheck.logos/logo1.png",
  "imageBgColor": 0,
  "canCreateNewClients": true,
  "clientDescriptor": true,
  "webSettings": "{ isRegularMode: true }",
  "clientSettings": "{ maxDaysForPreviousVisits: 30 }",
  "apiKeyGoogle": "abc123"
}

Properties

Name Type Required Restrictions Description
uuid string false none A unique UUID for this business
name string false none Business name
imageUrl string false none The brand image for this business, displayed in the mobile app
imageBgColor integer(int32) false none The background color for the image - used to color the background in the mobile app behind the imageUrl image
canCreateNewClients boolean false none A flag indicating whether this business allows new clients to be created
clientDescriptor string false none The text used to describe clients. Typically 'client' or 'survey' depending on the use-case. Changes the web CMS labelling.
webSettings string false none JSON string that contains various web CMS settings for the business that change how the CMS is displayed.
clientSettings string false none JSON string that contains various mobile client settings for the business that change how the mobile app displays data.
apiKeyGoogle string false none Google Maps API key for this business if the business has provided a paid-for key.

Role

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "canAccessAllClients": true,
  "canUseCMS": true,
  "canManagePayments": true,
  "permissions": "{ \"clients\": [\"post\", \"get\", \"put\", \"delete\"], \"locations\": [\"post\", \"get\"] }"
}

Properties

Name Type Required Restrictions Description
uuid string false none A unique UUID for this business
canAccessAllClients boolean false none A flag indicating whether this role can access all clients or only specified clients
canUseCMS boolean false none A flag indicating whether this role can access the web CMS
canManagePayments boolean false none A flag indicating whether this role can manage payments, including viewing invoices
permissions string false none A JSON string that describes the API endpoint access for this role

Client

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "name": "Store survey",
  "defaultLocationRange": 500,
  "canSetStatus": true,
  "canEditEquipment": true,
  "canOrderEquipment": true,
  "canSetCustom": true,
  "locationCustomDefinition": {},
  "photoResolution": "1024x768",
  "isArchived": true,
  "createdAt": "01/01/2023 09:00"
}

Properties

Name Type Required Restrictions Description
uuid string false none A unique UUID for this client
name string false none Client name
defaultLocationRange integer(int32) false none The default distance in metres to a site location for the location to be viewed as close or far
canSetStatus boolean false none A flag indicating whether the client includes a status setting
canEditEquipment boolean false none A flag indicating whether this client supports equipment editing
canOrderEquipment boolean false none A flag indicating whether this client supports ordering equipment
canSetCustom boolean false none A flag indicating whether this client supports custom-defined fields for each site location
locationCustomDefinition string false none A JSON string that describes the custom defined field types - only used if canSetCustom is true
photoResolution string false none A string defining the photo resolution captured by the mobile app
isArchived boolean false none A flag indicating whether this client is archived - using for the web CMS display
createdAt string false none The creation date of this client, format DD/MM/YYYY HH:mm

ClientWithDetail

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "name": "Store survey",
  "imageUrl": "https://s3-eu-west-1.amazonaws.com/popcheck.logos/logo1.png",
  "defaultLocationRange": 500,
  "photoResolution": "1024x768",
  "photoNameFormat": "p_l|l-s-q",
  "pdfNameFormat": "v-n",
  "canSetStatus": true,
  "canAddComments": true,
  "canEditEquipment": true,
  "canOrderEquipment": true,
  "canSetCustom": true,
  "locationStatusChoices": "Site closed;Site not found;Manager not available",
  "locationStatusMinSelect": 1,
  "locationStatusMaxSelect": 3,
  "locationCustomDefinition": {},
  "visitEditableSeconds": 3600,
  "isArchived": true,
  "requireGPS": true,
  "requiredLocationProximity": 1000,
  "defaultVisitsView": 0,
  "canSelectPhotoFromAlbum": true,
  "createdAt": "01/01/2023 09:00"
}

Properties

Name Type Required Restrictions Description
uuid string false none A unique UUID for this client
name string false none Client name
imageUrl string false none The brand image for this client, NOT USED AT PRESENT
defaultLocationRange integer(int32) false none The default distance in metres to a site location for the location to be viewed as close or far
photoResolution string false none A string defining the photo resolution captured by the mobile app
photoNameFormat string false none A string specifying how photos are named. p = photo tag prefix, l = location reference, c = campaign reference, v = visit refrerence, d = visit end date, s = survey section reference, n = survey section name, q = survey question reference, x = survey question.
pdfNameFormat string false none A string specifying how PDF reports are named. v = visit refrerence, l = location reference, n = location name, c = campaign reference, d = visit end date, u = uuid.
canSetStatus boolean false none A flag indicating whether the client includes support for setting status
canAddComments boolean false none A flag indicating whether the client includes support for adding comments
canEditEquipment boolean false none A flag indicating whether this client supports equipment editing
canOrderEquipment boolean false none A flag indicating whether this client supports ordering equipment
canSetCustom boolean false none A flag indicating whether this client supports custom-defined fields for each site location
locationStatusChoices string false none A semicolon delimited string with the status options
locationStatusMinSelect integer(int32) false none The minimum number of selections when setting the location status
locationStatusMaxSelect integer(int32) false none The maximum number of selections when setting the location status
locationCustomDefinition string false none A JSON string that describes the custom defined field types - only used if canSetCustom is true
visitEditableSeconds integer(int32) false none The number of seconds a visit is editable in the mobile app. After this time the visit cannot be edited in the app.
isArchived boolean false none A flag indicating whether this client is archived - using for the web CMS display
requireGPS boolean false none A flag indicating whether the mobile app must have GPS switched on or not
requiredLocationProximity integer(int32) false none If requireGPS then an also require the user to be at least this close in metres to the site location
defaultVisitsView integer(int32) false none An integer defining the initial mobile app view for visits. NOT PRESENTLY USED.
canSelectPhotoFromAlbum boolean false none A flag indicating whether the mobile user can select visits from the photo album or must use the camera instead
createdAt string false none The creation date of this client, format DD/MM/YYYY HH:mm

UUID

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
}

Properties

Name Type Required Restrictions Description
uuid string false none A unique UUID for this object

UUIDs

{
  "uuids": [
    "2dc92910-d87b-486c-933e-9c8977636c9e"
  ]
}

Properties

Name Type Required Restrictions Description
uuids [string] false none none

Campaign

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "reference": "c1",
  "name": "Store survey - Chiller cabinets",
  "startDate": "01/01/2023 09:00",
  "endDate": "01/02/2023 17:00",
  "documentLinks": "Site Information^https://s3-eu-west-1.amazonaws.com/popcheckapp.clientfiles/7be7c5cd-d4b5-4693-8198-1eb7335fe72f.pdf"
}

Properties

Name Type Required Restrictions Description
uuid string false none A unique UUID for this campaign
reference string false none Campaign reference
name string false none Campaign name
startDate string false none The start date for the campaign, format DD/MM/YYYY HH:mm
endDate string false none The end date for the campaign, format DD/MM/YYYY HH:mm
documentLinks string false none Any PDF documents for this campaign, displayed as links in the mobile app. Sent as a ; and ^ delimited string where ; separates documents and ^ splits the document into title and URL.

Location

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "reference": "l123",
  "name": "York store",
  "description": "On the corner opposite the bank",
  "lat": 1.2,
  "lng": 57.3,
  "range": 5000,
  "address0": "1 High Street",
  "address1": "Anytown",
  "address2": "My County",
  "postCode": "AA1 1BB",
  "telephoneNumber": "01234 567890",
  "equipment": "Tills^3;Display cabinets^2",
  "equipmentOrderChoices": "Hangers^Till Hangers^Shelf End Hangers;Poster Frames^Large Format^Small Format",
  "notes": "Manager name is Jim",
  "custom": "string"
}

Properties

Name Type Required Restrictions Description
uuid string false none A unique UUID for this location
reference string false none Location reference
name string false none Location name
description string false none Location descriptive text
lat number(double) false none Location latitude
lng number(double) false none Location longitude
range integer(int32) false none The distance in metres from the location for the mobile user to be considered in range
address0 string false none FFirst line of the location address
address1 string false none Second line of the location address
address2 string false none Third line of the location address
postCode string false none Location post code
telephoneNumber string false none Location telephone number
equipment string false none Delimited string describing the equipment at this location. Please contact us for further details.
equipmentOrderChoices string false none Delimited string describing the choices available to the mobile user for ordering equipment at this location. Please contact us for further details.
notes string false none Location-specific notes
custom string false none Location custom data, used in conjunction with locationCustomDefinition. Please contact us for further details.

Visit

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "reference": "v1",
  "flagType": 1,
  "flagData": 255,
  "scheduleStartDate": "01/01/2023 09:00",
  "scheduleEndDate": "01/02/2023 17:00",
  "actualStartDate": "01/01/2023 09:00",
  "actualEndDate": "01/02/2023 17:00",
  "Location": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "name": "Potters Bar store",
    "reference": "l1"
  },
  "Campaign": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "name": "POS review",
    "reference": "c1"
  },
  "User": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "name": "Jane Scott"
  }
}

Properties

Name Type Required Restrictions Description
uuid string false none A unique UUID for this visit
reference string false none Visit reference
flagType integer(int32) false none An optional indicator to add a marker beside this visit in the mobile app to highlight it. Options 1 - info icon, 2 - info icon selected, 3 - clock icon, 4 - clock icon selected, 5 - warning icon, 6 - warning icon selected, 7 - filled circle.
flagData string false none If flagType is set then flagData can be used to customise the icon color.
scheduleStartDate string false none The scheduled start date for this visit, format DD/MM/YYYY HH:mm
scheduleEndDate string false none The scheduled end date for this visit, format DD/MM/YYYY HH:mm
actualStartDate string false none The actual start date for this visit, format DD/MM/YYYY HH:mm
actualEndDate string false none The actual end date for this visit, format DD/MM/YYYY HH:mm
Location object false none none
» uuid string false none The unique UUID for this location
» name string false none Location name
» reference string false none Location reference
Campaign object false none none
» uuid string false none The unique UUID for this campaign
» name string false none Campaign name
» reference string false none Campaign reference
User object false none none
» uuid string false none The unique UUID for this user
» name string false none User name

VisitWithResults

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "reference": "v1",
  "flagType": 1,
  "flagData": 255,
  "scheduleStartDate": "01/01/2023 09:00",
  "scheduleEndDate": "01/02/2023 17:00",
  "actualStartDate": "01/01/2023 09:00",
  "actualEndDate": "01/02/2023 17:00",
  "startLat": 1.2,
  "startLng": 57.3,
  "startAccuracy": 20,
  "endLat": 1.2,
  "endLng": 57.3,
  "endAccuracy": 20,
  "Location": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "name": "Potters Bar store",
    "reference": "l1",
    "equipment": "Tills^3;Display cabinets^2",
    "equipmentOrderChoices": "Hangers^Till Hangers^Shelf End Hangers;Poster Frames^Large Format^Small Format",
    "custom": "string"
  },
  "Campaign": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "name": "POS review",
    "reference": "c1",
    "Client": {
      "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
      "name": "Superstore1",
      "reference": "client1"
    }
  },
  "User": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "name": "Jane Scott"
  },
  "LocationStatuses": [
    {
      "type": "status",
      "value": "Site closed for refurbishment"
    }
  ],
  "SurveyResponses": [
    {
      "answer": "Store opens on Tuesday",
      "SurveyQuestion": {
        "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
        "reference": "q2",
        "question": "When does the store open?",
        "sortOrder": 4,
        "type": "photo",
        "SurveySection": {
          "reference": "s4",
          "name": "General questions",
          "sortOrder": 2
        }
      }
    }
  ],
  "Photos": [
    {
      "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
      "url": "https://s3-eu-west-1.amazonaws.com/popcheck.photos/2dc92910-d87b-486c-933e-9c8977632cae.png",
      "lat": 1.5,
      "lng": 50.23,
      "accuracy": 25,
      "PhotoTag": {
        "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
        "reference": "p10",
        "name": "Take a photo of the main door",
        "prefix": "o_",
        "sortOrder": 1
      }
    }
  ]
}

Properties

Name Type Required Restrictions Description
uuid string false none A unique UUID for this visit
reference string false none Visit reference
flagType integer(int32) false none An optional indicator to add a marker beside this visit in the mobile app to highlight it. Options 1 - info icon, 2 - info icon selected, 3 - clock icon, 4 - clock icon selected, 5 - warning icon, 6 - warning icon selected, 7 - filled circle.
flagData string false none If flagType is set then flagData can be used to customise the icon color.
scheduleStartDate string false none The scheduled start date for this visit, format DD/MM/YYYY HH:mm
scheduleEndDate string false none The scheduled end date for this visit, format DD/MM/YYYY HH:mm
actualStartDate string false none The actual start date for this visit, format DD/MM/YYYY HH:mm
actualEndDate string false none The actual end date for this visit, format DD/MM/YYYY HH:mm
startLat number(double) false none Latitude of visit start based on mobile phone GPS
startLng number(double) false none Longitude of visit start based on mobile phone GPS
startAccuracy integer(int32) false none The accuracy in metres of the startLat and startLng, as reported by the mobile phone GPS
endLat number(double) false none Latitude of visit end based on mobile phone GPS
endLng number(double) false none Longitude of visit end based on mobile phone GPS
endAccuracy integer(int32) false none The accuracy in metres of the endLat and endLng, as reported by the mobile phone GPS
Location object false none none
» uuid string false none The unique UUID for this location
» name string false none Location name
» reference string false none Location reference
» equipment string false none Location equipment
» equipmentOrderChoices string false none Location equipment order choices
» custom string false none Location custom field values. Please contact us for details.
Campaign object false none none
» uuid string false none The unique UUID for this campaign
» name string false none Campaign name
» reference string false none Campaign reference
» Client object false none none
»» uuid string false none The unique UUID for this client
»» name string false none Client name
»» reference string false none Client reference
User object false none none
» uuid string false none The unique UUID for this user
» name string false none User name
LocationStatuses [object] false none none
» type string false none The location status type. One of 'status', 'comment', 'equipmentUpdate', 'equipmentOrder', 'custom'.
» value string false none The location status value for this type
SurveyResponses [object] false none none
» answer string false none The answer to the survey question
» SurveyQuestion object false none none
»» uuid string false none The unique UUID for this survey question
»» reference string false none Survey question reference
»» question string false none The survey question
»» sortOrder integer(int32) false none Survey question sort order
»» type string false none Survey question type
»» SurveySection object false none none
»»» reference string false none Survey section reference
»»» name string false none The survey section name
»»» sortOrder integer(int32) false none Survey section sort order
Photos [object] false none none
» uuid string false none The unique UUID for this photo
» url string false none URL to the photo
» lat number(double) false none Latitude of mobile device when this photo was taken
» lng number(double) false none Longitude of mobile device when this photo was taken
» accuracy integer(int32) false none Mobile phone reported GPS accuracy in metres when this photo was taken
» PhotoTag object false none none
»» uuid string false none The unique UUID for this overview photo
»» reference string false none Overview photo reference
»» name string false none The overview photo nane
»» prefix string false none Phototag prefix - for naming
»» sortOrder integer(int32) false none Overview photo sort order

Enumerated Values

Property Value
type status
type comment
type equipmentUpdate
type equipmentOrder
type custom
type multiselect
type text
type number
type date
type time
type dateTime
type signature
type barcode
type photo
type qrcode
type video

VisitNew

{
  "reference": "v1",
  "flagType": 1,
  "flagData": 255,
  "scheduleStartDate": "01/01/2023 09:00",
  "scheduleEndDate": "01/02/2023 17:00",
  "actualStartDate": "01/01/2023 09:00",
  "actualEndDate": "01/02/2023 17:00",
  "Location": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
  },
  "Campaign": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
  },
  "User": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
  }
}

Properties

Name Type Required Restrictions Description
reference string false none Visit reference
flagType integer(int32) false none An optional indicator to add a marker beside this visit in the mobile app to highlight it. Options 1 - info icon, 2 - info icon selected, 3 - clock icon, 4 - clock icon selected, 5 - warning icon, 6 - warning icon selected, 7 - filled circle.
flagData string false none If flagType is set then flagData can be used to customise the icon color.
scheduleStartDate string false none The scheduled start date for this visit, format DD/MM/YYYY HH:mm
scheduleEndDate string false none The scheduled end date for this visit, format DD/MM/YYYY HH:mm
actualStartDate string false none The actual start date for this visit, format DD/MM/YYYY HH:mm
actualEndDate string false none The actual end date for this visit, format DD/MM/YYYY HH:mm
Location object false none none
» uuid string false none The unique UUID for this location
Campaign object false none none
» uuid string false none The unique UUID for this campaign
User object false none none
» uuid string false none The unique UUID for this user

VisitNewWithUUID

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "reference": "v1",
  "flagType": 1,
  "flagData": 255,
  "scheduleStartDate": "01/01/2023 09:00",
  "scheduleEndDate": "01/02/2023 17:00",
  "actualStartDate": "01/01/2023 09:00",
  "actualEndDate": "01/02/2023 17:00",
  "Location": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
  },
  "Campaign": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
  },
  "User": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e"
  }
}

Properties

Name Type Required Restrictions Description
uuid string false none The unique UUID for this visit
reference string false none Visit reference
flagType integer(int32) false none An optional indicator to add a marker beside this visit in the mobile app to highlight it. Options 1 - info icon, 2 - info icon selected, 3 - clock icon, 4 - clock icon selected, 5 - warning icon, 6 - warning icon selected, 7 - filled circle.
flagData string false none If flagType is set then flagData can be used to customise the icon color.
scheduleStartDate string false none The scheduled start date for this visit, format DD/MM/YYYY HH:mm
scheduleEndDate string false none The scheduled end date for this visit, format DD/MM/YYYY HH:mm
actualStartDate string false none The actual start date for this visit, format DD/MM/YYYY HH:mm
actualEndDate string false none The actual end date for this visit, format DD/MM/YYYY HH:mm
Location object false none none
» uuid string false none The unique UUID for this location
Campaign object false none none
» uuid string false none The unique UUID for this campaign
User object false none none
» uuid string false none The unique UUID for this user

Medium

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "url": "https://s3-eu-west-1.amazonaws.com/popcheck.photos/2dc92910-d87b-486c-933e-9c8977632cae.png"
}

Properties

Name Type Required Restrictions Description
uuid string false none A unique UUID for this media item
url string false none The url of this media item

PhotoTag

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "name": "Front door photo",
  "orientation": "landscape",
  "prefix": "fd_",
  "isRequired": true,
  "sortOrder": 3
}

Properties

Name Type Required Restrictions Description
uuid string false none A unique UUID for this overview photo
name string false none Photo name
orientation string false none The orientation of the photo, one of portrait, landscape or any
prefix string false none A prefix for this overview photo - used to help with photo naming
isRequired boolean false none A flag indicating whether this overview photo is required
sortOrder integer(int32) false none The sort order for this overview photo, starting from 0

Enumerated Values

Property Value
orientation portrait
orientation landscape
orientation any

SurveySection

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "reference": "s1",
  "name": "Chiller 1",
  "startDate": "01/01/2023 09:00",
  "endDate": "01/02/2023 17:00",
  "sortOrder": 1,
  "conditionQuestion": "q1",
  "condition": "=",
  "conditionValue": "yes",
  "SurveyQuestions": [
    {
      "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
      "reference": "q100",
      "question": "What is the make of the chiller?",
      "sortOrder": 1,
      "type": "signature",
      "choices": "Samsung;LG;Other",
      "minSelect": 1,
      "maxSelect": 3,
      "isRequired": true,
      "conditionQuestion": "q1",
      "condition": "=",
      "conditionValue": "yes"
    }
  ]
}

Properties

Name Type Required Restrictions Description
uuid string false none A unique UUID for this survey section
reference string false none Survey section reference
name string false none Survey section name
startDate string false none The start date for the survey section availability, format DD/MM/YYYY HH:mm
endDate string false none The end date for the survey section availability, format DD/MM/YYYY HH:mm
sortOrder integer(int32) false none The sort order for this survey section, starting from 0
conditionQuestion string false none The condition question reference (if any) for displaying this survey section
condition string false none The condition type (if any) for the comparison. One of '<', '<=', '=', '>', '>=', '<>', 'includes' or 'any'
conditionValue string false none The condition value that is compared with the conditionQuestion value using the condition operator
SurveyQuestions [SurveyQuestion] false none none

SurveyQuestion

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "reference": "q100",
  "question": "What is the make of the chiller?",
  "sortOrder": 1,
  "type": "signature",
  "choices": "Samsung;LG;Other",
  "minSelect": 1,
  "maxSelect": 3,
  "isRequired": true,
  "conditionQuestion": "q1",
  "condition": "=",
  "conditionValue": "yes"
}

Properties

Name Type Required Restrictions Description
uuid string false none A unique UUID for this survey question
reference string false none Survey question reference
question string false none The survey question
sortOrder integer(int32) false none The sort order for this survey section, starting from 0
type string false none The question type - like multiselect, text or photo
choices string false none The choices for this question. Available choices depend on the type. For 'multiselect', choices lists the choices available, separated by a ';'. For 'photo', choices sets the photo orientation to one of portrait, landscape or any. For 'video', choices sets the maximum video duration in seconds.
minSelect integer(int32) false none For 'multiselect' this is used to set the minimum number of selections that can be made.
maxSelect integer(int32) false none For 'multiselect' this is used to set the maximum number of selections that can be made.
isRequired boolean false none A flag indicating whether this survey question must be completed
conditionQuestion string false none The condition question reference (if any) for displaying this survey question
condition string false none The condition type (if any) for the comparison. One of '<', '<=', '=', '>', '>=', '<>', 'includes' or 'any'
conditionValue string false none The condition value that is compared with the conditionQuestion value using the condition operator

Enumerated Values

Property Value
type multiselect
type text
type number
type date
type time
type dateTime
type signature
type barcode
type photo
type qrcode
type video

User

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "name": "Janet",
  "email": "janet@example.com",
  "Role": {
    "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "name": "Mobile user",
    "canAccessAllClients": true
  }
}

Properties

Name Type Required Restrictions Description
uuid string false none A unique UUID for this user
name string false none User name
email string false none User email
Role object false none none
» uuid string false none A unique UUID for this business
» name string false none The name of this role
» canAccessAllClients boolean false none A flag indicating whether this role can access all clients or only specified clients

UserNew

{
  "name": "Janet",
  "email": "janet@example.com",
  "roleUUID": "2dc92910-d87b-486c-933e-9c8977636c9e"
}

Properties

Name Type Required Restrictions Description
name string false none User name
email string false none User email
roleUUID string false none The role UUID for the new user

RoleCore

{
  "uuid": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "name": "Mobile user",
  "description": "Mobile client role",
  "canAccessAllClients": true,
  "canCompleteVisits": true
}

Properties

Name Type Required Restrictions Description
uuid string false none A unique UUID for this role
name string false none Role name
description string false none Role description
canAccessAllClients boolean false none A flag indicating whether this role can access all clients or only specified clients
canCompleteVisits boolean false none A flag indicating whether this role can complete visits with the mobile app