API Reference

Overview

Build functions to integrate with your core platform.

Sample-Kiosk provides a suite of simple and flexible API endpoints to manage your data

Quick Start

  1. Setup a free account
  2. Get your authentication details, username/password
  3. Try an authentication to get your bearer token
Replacing the values with your own, use the cURL request below
 curl -X POST \/n
  -d 'email=YOUR-EMAIL@sample-kiosk.com' \
  -d 'password=password' \
  https://api.sample-kiosk.com/api/v1/auth

Testing

You can begin testing with a Free account. Once your account is setup you can use a program called Postman or cURL to begin testing.

API Authentication

All Sample-Kiosk API calls require authentication:

All Sample-Kiosk API calls require authentication:

  • email: Parameters to retrieve bearer token
  • password: website login credentials

Replacing the values with your own, use the cURL request below
 curl -X POST \
  -d 'email=YOUR-EMAIL@sample-kiosk.com' \
  -d 'password=password' \
  https://api.sample-kiosk.com/api/v1/auth
Success response
 {
  "access_token": "TOKEN_RETURNED_FROM_SERVER",
  "token_type": "bearer",
  "expires_in": 604800
 }
Bearer token for data requests

  • token: retrieved with email and password

Read Projects

List all projects you have access to

Example request

Replacing the values with your own, use the cURL request below
 curl -X GET \
  -H 'Accept: application/json' \
  -H "Authorization: Bearer TOKEN_RETURNED_FROM_SERVER" \
  https://api.sample-kiosk.com/api/v1/projects
Success response
 {
  "projects": [
  {
  "id": "9b0223e1-a910-4779-86d8-5948117c07b2",
  "name": "project",
  "projects_users": [
  {
  "role": "Admin"
  }
  ]
  },
  {
  "id": "645b3a9d-44ac-4021-9df2-e97649111b57",
  "name": "Project testing",
  "projects_users": [
  {
  "role": "Admin"
  }
  ]
  }
  ]
 }

List Samples

List all samples you have access to

Giving a project_id : will show those specific samples

Example request

Replacing the values with your own, use the cURL request below
 curl -X GET \
  -d 'project_id=9b0223e1-a910-4779-86d8-5948117c07b2' \
  -H 'Accept: application/json' \
  -H "Authorization: Bearer TOKEN_RETURNED_FROM_SERVER" \
  https://api.sample-kiosk.com/api/v1/samples
Success response
 {
  "samples": [
  {
  "id": "abcd8cac-1ae9-479f-bc44-cf40f0324de3",
  "created_at": "2023-10-01T20:03:17.472849+00:00",
  "project_id": "9b0223e1-a910-4779-86d8-5948117c07b2",
  "email": "YOUR-EMAIL@sample-kiosk.com",
  "form_name": "form",
  "field1": "lkj",
  "field2": "lkj",
  "field3": "lkj",
  "field4": "lkj",
  "field5": "lkj",
  "collected_at": "2023-10-01 20:03:17.300Z",
  "field1_upload": "",
  "field2_upload": "",
  "field3_upload": "",
  "field4_upload": "",
  "field5_upload": ""
  }
  ]
 }

Delete Sample

Delete sample

Example request

Replacing the values with your own, use the cURL request below
 curl -X DELETE \/n
  -H "Accept: application/json" \
  -H "Authorization: Bearer TOKEN_RETURNED_FROM_SERVER" \
  https://api.sample-kiosk.com/api/v1/samples/abcd8cac-1ae9-479f-bc44-cf40f0324de3
Success response
ok