NAV
Curl JavaScript PHP Python Ruby Go Java

POP Check API v2.1.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.

The POP Check API enables management of field survey operations including clients, campaigns, locations, visits, survey responses, photos, and users.

Base URL: https://api.popcheck.com/v2/

Authentication: All endpoints except POST /login require a Bearer token. Include the token in the Authorization header.

Typical flow:
1. POST /login with email and password to obtain a Bearer token
2. GET /clients to retrieve available clients and their UUIDs
3. Use the client UUID in subsequent requests — e.g. GET /locations/{clientUUID}, GET /visits/{clientUUID}
4. Create, update, or delete resources using POST, PUT, PATCH, and DELETE methods

Query parameters: Most GET endpoints support *Attributes parameters (comma-separated field names) to control which fields are returned, and include* boolean parameters to include related data.

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 or request a password reset 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,
      "canAddComments": 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,
      "canAddComments": 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 - invalid API token None

Clients

The /clients endpoint is for managing clients. A client defines a survey project with its configuration including photo resolution, survey settings, location status options, and equipment tracking.

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

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

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

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
campaignAttributes query string false Comma-separated list of campaign fields to return (uuid, reference, name, startDate, endDate, documentLinks)
startDate query string false ISO 8601 date - filter campaigns overlapping this date range
endDate query string false ISO 8601 date - used with startDate for date range filter
limit query integer false Maximum number of campaigns to return

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
413 Payload Too Large response too large - download URL provided 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 true 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
409 Conflict campaign name already in use None
422 Unprocessable Entity unprocessable entity - name not set None

List campaigns grouped by date

Code samples

# You can also use wget
curl -X GET https://api.popcheck.com/v2/campaigns/{clientUUID}/actions/groupByDate \
  -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}/actions/groupByDate',
{
  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}/actions/groupByDate', 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}/actions/groupByDate', 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}/actions/groupByDate',
  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}/actions/groupByDate", data)
    req.Header = headers

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

URL obj = new URL("https://api.popcheck.com/v2/campaigns/{clientUUID}/actions/groupByDate");
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}/actions/groupByDate

Get all campaigns for this client grouped by date range

Parameters

Name In Type Required Description
clientUUID path string true none

Example responses

200 Response

[
  {
    "startDate": "string",
    "endDate": "string",
    "uuids": [
      "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

Response Schema

Status Code 200

Name Type Required Restrictions Description
» startDate string false none none
» endDate string false none none
» uuids [string] false none 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 true 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
409 Conflict campaign name already in use None
422 Unprocessable Entity unprocessable entity - name not set 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
locationAttributes query string false Comma-separated list of location fields to return
includeVisits query boolean false Include recent visits on locations
requireVisits query boolean false Only return locations that have visits
visitAttributes query string false Comma-separated list of visit fields when including visits
includeUsers query boolean false Include user data on visits
userAttributes query string false Comma-separated list of user fields
includeCampaigns query boolean false Include campaign data on visits
campaignAttributes query string false Comma-separated list of campaign fields
includeSurveyResponses query boolean false Include survey responses on visits
scheduleStartDate query string false ISO 8601 date - filter visits by schedule start
scheduleEndDate query string false ISO 8601 date - filter visits by schedule end
maxVisits query integer false Maximum visits per location
minVisits query integer false Minimum visits required per location

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",
    "address3": "Region",
    "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
413 Payload Too Large response too large - download URL provided 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 First 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
» address3 string false none Fourth 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",
  "address3": "Region",
  "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",
  "address3": "Region",
  "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

Example responses

200 Response

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

Responses

Status Meaning Description Schema
200 OK successful operation (single item) UUID
204 No Content successful operation (bulk array) 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 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
includeVisits query boolean false Include visits for this location
requireVisits query boolean false Only return if location has visits
visitAttributes query string false Comma-separated list of visit fields
includeUsers query boolean false Include user data on visits
includeCampaigns query boolean false Include campaign data on visits
campaignAttributes query string false Comma-separated list of campaign fields
maxVisits query integer false Maximum visits to return
minVisits query integer false Minimum visits required

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",
  "address3": "Region",
  "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 location not found None
413 Payload Too Large response too large - download URL provided 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",
  "address3": "Region",
  "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",
  "address3": "Region",
  "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 true 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 First 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
address3 body string false Fourth 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

Update locations

Code samples

# You can also use wget
curl -X PUT https://api.popcheck.com/v2/locations \
  -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",
    "address3": "Region",
    "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',
{
  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', 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', 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',
  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", data)
    req.Header = headers

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

URL obj = new URL("https://api.popcheck.com/v2/locations");
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

Update multiple locations

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",
    "address3": "Region",
    "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
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 all locations

Code samples

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


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

fetch('https://api.popcheck.com/v2/locations/{clientUUID}/actions/all',
{
  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/{clientUUID}/actions/all', 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/{clientUUID}/actions/all', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

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

result = RestClient.delete 'https://api.popcheck.com/v2/locations/{clientUUID}/actions/all',
  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/{clientUUID}/actions/all", data)
    req.Header = headers

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

URL obj = new URL("https://api.popcheck.com/v2/locations/{clientUUID}/actions/all");
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/{clientUUID}/actions/all

Delete all locations for 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

Visits

The /visits endpoint supports defining and managing user visits to locations, including visit completion data, survey responses, and location statuses.

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
visitAttributes query string false Comma-separated list of visit fields to return
locationAttributes query string false Comma-separated list of location fields
campaignAttributes query string false Comma-separated list of campaign fields
userAttributes query string false Comma-separated list of user fields
surveyQuestionAttributes query string false Comma-separated list of survey question fields
surveySectionAttributes query string false Comma-separated list of survey section fields
photoAttributes query string false Comma-separated list of photo fields
photoTagAttributes query string false Comma-separated list of photo tag fields
includeLocations query boolean false Include location data on visits
includeCampaigns query boolean false Include campaign data on visits
includeUsers query boolean false Include user data on visits
includeLocationStatusTypes query string false Comma-separated list of location status types to include
requireLocationStatusTypes query boolean false Require location status types
includeSurveyResponses query boolean false Include survey responses on visits
requireSurveyResponses query boolean false Only return visits with survey responses
surveyQuestionUUIDs query string false Comma-separated UUIDs to filter survey questions
surveySectionUUIDs query string false Comma-separated UUIDs to filter survey sections
includePhotos query boolean false Include photos on visits
requirePhotos query boolean false Only return visits with photos
photoTagUUIDs query string false Comma-separated UUIDs to filter by photo tags
userUUIDs query string false Comma-separated UUIDs to filter by user
campaignUUIDs query string false Comma-separated UUIDs to filter by campaign
locationUUIDs query string false Comma-separated UUIDs to filter by location
campaignStartDate query string false ISO 8601 date - campaign date filter start
campaignEndDate query string false ISO 8601 date - campaign date filter end
scheduleStartDate query string false ISO 8601 date - visit schedule range start
scheduleEndDate query string false ISO 8601 date - visit schedule range end
isCompleted query boolean false Filter by completion status
isOnTime query boolean false Filter by on-time completion (used with isCompleted)
hasLatLng query boolean false Filter by presence of GPS coordinates
limit query integer false Maximum number of visits to return
offset query integer false Pagination offset
surveyResponsesLimit query integer false Maximum survey responses per visit
forceRequireSurveyQuestionSurveySectionPhotoTag query boolean false Require survey question, section, and photo tag associations

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
413 Payload Too Large response too large - download URL provided 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 = '{
  "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',
  '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

{
  "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"
  }
}

Parameters

Name In Type Required Description
clientUUID path string true none

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 - missing Location, Campaign or User uuid None
404 Not Found location, campaign or user UUID not found None
413 Payload Too Large too many active visits per user None

List visits with counts

Code samples

# You can also use wget
curl -X GET https://api.popcheck.com/v2/visits/{clientUUID}/actions/count \
  -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}/actions/count',
{
  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}/actions/count', 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}/actions/count', 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}/actions/count',
  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}/actions/count", data)
    req.Header = headers

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

URL obj = new URL("https://api.popcheck.com/v2/visits/{clientUUID}/actions/count");
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}/actions/count

Get all visits for this client with photo and survey response counts instead of full sub-objects

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 - visits with Photos and SurveyResponses as count objects 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 [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

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
pdf query boolean false Return a PDF representation instead of JSON
timestamp query boolean false Include timestamp in PDF (default true)
timezone query string false Timezone for PDF dates (default Europe/London)
forceRequireSurveyQuestionSurveySectionPhotoTag query boolean false Require survey question, section, and photo tag associations

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
      }
    }
  ],
  "dateNow": "2023-06-15T14:30:00.000Z"
}

Responses

Status Meaning Description Schema
200 OK successful operation - returns JSON visit or PDF depending on pdf query parameter VisitWithResults
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
413 Payload Too Large response too large - download URL provided None

Patch a visit

Code samples

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

const inputBody = '{
  "actualStartDate": "string",
  "actualEndDate": "string",
  "dateNow": "string",
  "startLat": 0,
  "startLng": 0,
  "startAccuracy": 0,
  "endLat": 0,
  "endLng": 0,
  "endAccuracy": 0,
  "deviceInfo": "string",
  "appVersion": "string",
  "LocationStatuses": [
    {
      "type": "status",
      "value": "string"
    }
  ],
  "SurveyResponses": [
    {
      "answer": "string",
      "surveyQuestionUUID": "string"
    }
  ],
  "Media": [
    {
      "filename": "string",
      "photoTagUUID": "string",
      "surveyQuestionUUID": "string",
      "lat": 0,
      "lng": 0,
      "accuracy": 0,
      "isPrevious": true
    }
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/visits/{visitUUID}',
{
  method: 'PATCH',
  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('PATCH','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.patch('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.patch '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("PATCH", "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("PATCH");
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());

PATCH /visits/{visitUUID}

Patch a visit with completion data from the mobile client, including media, survey responses, and location statuses

Body parameter

{
  "actualStartDate": "string",
  "actualEndDate": "string",
  "dateNow": "string",
  "startLat": 0,
  "startLng": 0,
  "startAccuracy": 0,
  "endLat": 0,
  "endLng": 0,
  "endAccuracy": 0,
  "deviceInfo": "string",
  "appVersion": "string",
  "LocationStatuses": [
    {
      "type": "status",
      "value": "string"
    }
  ],
  "SurveyResponses": [
    {
      "answer": "string",
      "surveyQuestionUUID": "string"
    }
  ],
  "Media": [
    {
      "filename": "string",
      "photoTagUUID": "string",
      "surveyQuestionUUID": "string",
      "lat": 0,
      "lng": 0,
      "accuracy": 0,
      "isPrevious": true
    }
  ]
}

Parameters

Name In Type Required Description
visitUUID path string true none
actualStartDate body string true ISO 8601 format date
actualEndDate body string true ISO 8601 format date
dateNow body string true ISO 8601 format date - current device time
startLat body number true none
startLng body number true none
startAccuracy body integer true none
endLat body number true none
endLng body number true none
endAccuracy body integer true none
deviceInfo body string false none
appVersion body string false none
LocationStatuses body [object] false none
» type body string false none
» value body string false none
SurveyResponses body [object] false none
» answer body string false none
» surveyQuestionUUID body string false none
Media body [object] false Array of media items - photos or videos to attach to the visit
» filename body string false none
» photoTagUUID body string false none
» surveyQuestionUUID body string false none
» lat body number false none
» lng body number false none
» accuracy body integer false none
» isPrevious body boolean false none

Enumerated Values

Parameter Value
» type status
» type comment
» type equipmentUpdate
» type equipmentOrder
» type custom

Responses

Status Meaning Description Schema
204 No Content successful operation None
401 Unauthorized unauthorised - invalid API token None
403 Forbidden invalid user for this visit None
404 Not Found visit not found None
422 Unprocessable Entity unprocessable entity - invalid visit data 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. When Location.uuid is present in the body, the CMS update path is used (VisitNew schema). Otherwise the mobile client path is used with visit completion fields.

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

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
422 Unprocessable Entity unprocessable entity - invalid visit data from mobile client 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

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
404 Not Found visit, location, campaign or user UUID 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
404 Not Found visit not found None

Delete all visits

Code samples

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


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

fetch('https://api.popcheck.com/v2/visits/{clientUUID}/actions/all',
{
  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/{clientUUID}/actions/all', 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/{clientUUID}/actions/all', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

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

result = RestClient.delete 'https://api.popcheck.com/v2/visits/{clientUUID}/actions/all',
  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/{clientUUID}/actions/all", data)
    req.Header = headers

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

URL obj = new URL("https://api.popcheck.com/v2/visits/{clientUUID}/actions/all");
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/{clientUUID}/actions/all

Delete all visits for 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

Media

The /media endpoint is for getting media like photos and videos, with filtering by photo tag, survey question, user, location, and campaign.

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
photoTagUUID query string false Filter by photo tag UUID
surveyQuestionUUID query string false Filter by survey question UUID
userUUID query string false Filter by user UUID
locationUUID query string false Filter by location UUID
description query string false Filter locations by description
campaignUUID query string false Filter by campaign UUID
scheduleStartDate query string false ISO 8601 date - filter visits by schedule start
scheduleEndDate query string false ISO 8601 date - filter visits by schedule end
forceLargeResponse query boolean false Force response to be stored in S3 and return download URL
visitAttributes query string false Comma-separated list of visit fields
locationAttributes query string false Comma-separated list of location fields
campaignAttributes query string false Comma-separated list of campaign fields
userAttributes query string false Comma-separated list of user fields
surveyQuestionAttributes query string false Comma-separated list of survey question fields
photoTagAttributes query string false Comma-separated list of photo tag fields

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",
    "PhotoTag": {
      "uuid": "string",
      "name": "string"
    },
    "SurveyQuestion": {
      "uuid": "string",
      "question": "string"
    },
    "Visit": {
      "uuid": "string",
      "Location": {
        "uuid": "string",
        "name": "string"
      },
      "Campaign": {
        "uuid": "string",
        "name": "string"
      },
      "User": {
        "uuid": "string",
        "name": "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
413 Payload Too Large response too large - download URL provided None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Medium] false none [A media item with optional nested associations (PhotoTag, SurveyQuestion, Visit with Location/Campaign/User) depending on query parameters]
» uuid string false none A unique UUID for this media item
» url string false none The url of this media item
» PhotoTag object false none none
»» uuid string false none none
»» name string false none none
» SurveyQuestion object false none none
»» uuid string false none none
»» question string false none none
» Visit object false none none
»» uuid string false none none
»» Location object false none none
»»» uuid string false none none
»»» name string false none none
»» Campaign object false none none
»»» uuid string false none none
»»» name string false none none
»» User object false none none
»»» uuid string false none none
»»» name string false none none

Photo Tags

The /phototags endpoint supports defining photo categories that organise the photos taken during a visit.

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
photoTagAttributes query string false Comma-separated list of photo tag fields to return (uuid, reference, name, orientation, prefix, isRequired, sortOrder)

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
413 Payload Too Large response too large - download URL provided 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 true none Photo name
» orientation string true none The orientation of the photo, one of portrait, landscape or any
» prefix string true 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) true 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

Example responses

200 Response

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

Responses

Status Meaning Description Schema
200 OK successful operation (single item) UUID
204 No Content successful operation (bulk array) None
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 true none
uuid body string false A unique UUID for this overview photo
name body string true Photo name
orientation body string true The orientation of the photo, one of portrait, landscape or any
prefix body string true 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) true 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

Update photo tags

Code samples

# You can also use wget
curl -X PUT https://api.popcheck.com/v2/phototags \
  -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',
{
  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', 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', 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',
  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", data)
    req.Header = headers

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

URL obj = new URL("https://api.popcheck.com/v2/phototags");
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

Update multiple photo tags

Body parameter

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

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 all photo tags

Code samples

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


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

fetch('https://api.popcheck.com/v2/phototags/{clientUUID}/actions/all',
{
  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/{clientUUID}/actions/all', 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/{clientUUID}/actions/all', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

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

result = RestClient.delete 'https://api.popcheck.com/v2/phototags/{clientUUID}/actions/all',
  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/{clientUUID}/actions/all", data)
    req.Header = headers

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

URL obj = new URL("https://api.popcheck.com/v2/phototags/{clientUUID}/actions/all");
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/{clientUUID}/actions/all

Delete all photo tags for 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

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
surveySectionAttributes query string false Comma-separated list of survey section fields to return
surveyQuestionAttributes query string false Comma-separated list of survey question fields to return
startDate query string false ISO 8601 date - filter sections available in this date range
endDate query string false ISO 8601 date - used with startDate for availability filter

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
413 Payload Too Large response too large - download URL provided 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

Example responses

200 Response

{
  "uuids": [
    "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
413 Payload Too Large too many survey questions None

Response Schema

Status Code 200

Name Type Required Restrictions Description
» uuids [string] false none 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 true 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
404 Not Found survey section or question not found 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

Parameters

Name In Type Required Description
includeRoles query boolean false Include role information in each user object
userAttributes query string false Comma-separated list of user fields to return (uuid, name, email, lastSeen, appVersion, deviceInfo)

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
    },
    "Clients": [
      {
        "uuid": "string",
        "name": "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

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
» Clients [object] false none Only present when role canAccessAllClients is false. Lists the specific clients this user can access.
»» uuid string false none none
»» name string false none none

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",
  "password": "mypassword123",
  "roleUUID": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "clientUUIDs": [
    "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 an array of users to create multiple.

Body parameter

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

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 role UUID not set or invalid None
409 Conflict email already in use None

Update users

Code samples

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

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

fetch('https://api.popcheck.com/v2/users',
{
  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', 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', 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',
  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", 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("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

Update multiple users

Body parameter

[
  {
    "uuid": "string",
    "name": "Janet",
    "email": "janet@example.com",
    "password": "mypassword123",
    "roleUUID": "2dc92910-d87b-486c-933e-9c8977636c9e",
    "clientUUIDs": [
      "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
404 Not Found user or role UUID not found 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
includeRoles query boolean false Include role information in each user object
userAttributes query string false Comma-separated list of user fields to return (uuid, name, email, lastSeen, appVersion, deviceInfo)

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
    },
    "Clients": [
      {
        "uuid": "string",
        "name": "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 [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
» Clients [object] false none Only present when role canAccessAllClients is false. Lists the specific clients this user can access.
»» uuid string false none none
»» name string false none none

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",
  "password": "mypassword123",
  "roleUUID": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "clientUUIDs": [
    "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",
  "password": "mypassword123",
  "roleUUID": "2dc92910-d87b-486c-933e-9c8977636c9e",
  "clientUUIDs": [
    "2dc92910-d87b-486c-933e-9c8977636c9e"
  ]
}

Parameters

Name In Type Required Description
userUUID path string true none
body body UserNew true none
name body string false User name
email body string false User email
password body string false User password
roleUUID body string false The role UUID for the new user
clientUUIDs body [string] false Array of client UUIDs this user can access (when role canAccessAllClients is false)

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 or role UUID invalid None
409 Conflict email already in use 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

Files

The /files endpoint is for uploading PDF files for visit forms.

Upload a file

Code samples

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

const inputBody = '{
  "file": "string"
}';
const headers = {
  'Content-Type':'multipart/form-data',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/files',
{
  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' => 'multipart/form-data',
    '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/files', 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': 'multipart/form-data',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

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

print(r.json())

require 'rest-client'
require 'json'

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

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

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

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

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

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

URL obj = new URL("https://api.popcheck.com/v2/files");
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 /files

Upload a PDF file. Accepts multipart/form-data with a single PDF file (max 5 MB).

Body parameter

file: string

Parameters

Name In Type Required Description
file body string(binary) false PDF file to upload (max 5 MB)

Example responses

200 Response

{
  "url": "https://s3-eu-west-1.amazonaws.com/popcheckapp.clientfiles/1dc92910-d87b-486c-933e-9c8977636c9e.pdf"
}

Responses

Status Meaning Description Schema
200 OK successful operation Inline
401 Unauthorized unauthorised - invalid API token None
403 Forbidden unauthorised - user does not have CMS access None
422 Unprocessable Entity invalid request - not multipart/form-data, bad file type, or file too large/small None

Response Schema

Status Code 200

Name Type Required Restrictions Description
» url string false none The public URL of the uploaded file

Downloads

The /downloads endpoint is for requesting zip file downloads of media (photos/videos) and visit PDFs. Requests are queued and processed asynchronously.

Download media

Code samples

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

const inputBody = '{
  "uuids": [
    "2dc92910-d87b-486c-933e-9c8977636c9e"
  ],
  "timezone": "Europe/London"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/downloads/media',
{
  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/downloads/media', 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/downloads/media', 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/downloads/media',
  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/downloads/media", data)
    req.Header = headers

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

URL obj = new URL("https://api.popcheck.com/v2/downloads/media");
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 /downloads/media

Request a zip file of media (photos/videos) for the given UUIDs. The request is queued and the zip is generated asynchronously. Large sets are automatically split into multiple zip files.

Body parameter

{
  "uuids": [
    "2dc92910-d87b-486c-933e-9c8977636c9e"
  ],
  "timezone": "Europe/London"
}

Parameters

Name In Type Required Description
uuids body [string] true Array of media (photo) UUIDs to include in the download
timezone body string true Timezone identifier used for file naming

Example responses

200 Response

{
  "requestCount": 1
}

Responses

Status Meaning Description Schema
200 OK successful operation Inline
401 Unauthorized unauthorised - invalid API token or missing/invalid UUIDs None
422 Unprocessable Entity insufficient permissions to access one or more media None

Response Schema

Status Code 200

Name Type Required Restrictions Description
» requestCount integer false none Number of zip file requests created (large sets are split across multiple zips)

Download visits

Code samples

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

const inputBody = '{
  "uuids": [
    "2dc92910-d87b-486c-933e-9c8977636c9e"
  ],
  "timezone": "Europe/London"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://api.popcheck.com/v2/downloads/visits',
{
  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/downloads/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',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://api.popcheck.com/v2/downloads/visits', 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/downloads/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"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

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

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

URL obj = new URL("https://api.popcheck.com/v2/downloads/visits");
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 /downloads/visits

Request a zip file of visit PDFs for the given UUIDs. The request is queued and the zip is generated asynchronously. Large sets are automatically split into multiple zip files.

Body parameter

{
  "uuids": [
    "2dc92910-d87b-486c-933e-9c8977636c9e"
  ],
  "timezone": "Europe/London"
}

Parameters

Name In Type Required Description
uuids body [string] true Array of visit UUIDs to include in the download
timezone body string true Timezone identifier used for file naming

Example responses

200 Response

{
  "requestCount": 1
}

Responses

Status Meaning Description Schema
200 OK successful operation Inline
401 Unauthorized unauthorised - invalid API token or missing/invalid UUIDs None
422 Unprocessable Entity insufficient permissions to access one or more visits None

Response Schema

Status Code 200

Name Type Required Restrictions Description
» requestCount integer false none Number of zip file requests created (large sets are split across multiple zips)

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,
      "canAddComments": 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,
  "canAddComments": 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
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
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",
  "address3": "Region",
  "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 First 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
address3 string false none Fourth 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
      }
    }
  ],
  "dateNow": "2023-06-15T14:30:00.000Z"
}

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
dateNow string false none The current server date/time in ISO 8601 format (included in single visit GET response)

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",
  "PhotoTag": {
    "uuid": "string",
    "name": "string"
  },
  "SurveyQuestion": {
    "uuid": "string",
    "question": "string"
  },
  "Visit": {
    "uuid": "string",
    "Location": {
      "uuid": "string",
      "name": "string"
    },
    "Campaign": {
      "uuid": "string",
      "name": "string"
    },
    "User": {
      "uuid": "string",
      "name": "string"
    }
  }
}

A media item with optional nested associations (PhotoTag, SurveyQuestion, Visit with Location/Campaign/User) depending on query parameters

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 object false none none
» uuid string false none none
» name string false none none
SurveyQuestion object false none none
» uuid string false none none
» question string false none none
Visit object false none none
» uuid string false none none
» Location object false none none
»» uuid string false none none
»» name string false none none
» Campaign object false none none
»» uuid string false none none
»» name string false none none
» User object false none none
»» uuid string false none none
»» name string false none none

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 true none Photo name
orientation string true none The orientation of the photo, one of portrait, landscape or any
prefix string true 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) true 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
  },
  "Clients": [
    {
      "uuid": "string",
      "name": "string"
    }
  ]
}

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
Clients [object] false none Only present when role canAccessAllClients is false. Lists the specific clients this user can access.
» uuid string false none none
» name string false none none

UserNew

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

Properties

Name Type Required Restrictions Description
name string false none User name
email string false none User email
password string false none User password
roleUUID string false none The role UUID for the new user
clientUUIDs [string] false none Array of client UUIDs this user can access (when role canAccessAllClients is false)