Get person list.
GET
/customer-api/v1/persons
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");curl_easy_setopt(hnd, CURLOPT_URL, "https://your-instance.seventhings.com/customer-api/v1/persons?page=1&per_page=50&sort_by=id&order=asc");
struct curl_slist *headers = NULL;headers = curl_slist_append(headers, "Authorization: Bearer <token>");curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Get, RequestUri = new Uri("https://your-instance.seventhings.com/customer-api/v1/persons?page=1&per_page=50&sort_by=id&order=asc"), Headers = { { "Authorization", "Bearer <token>" }, },};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://your-instance.seventhings.com/customer-api/v1/persons?page=1&per_page=50&sort_by=id&order=asc"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://your-instance.seventhings.com/customer-api/v1/persons?page=1&per_page=50&sort_by=id&order=asc")) .header("Authorization", "Bearer <token>") .method("GET", HttpRequest.BodyPublishers.noBody()) .build();HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.body());OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder() .url("https://your-instance.seventhings.com/customer-api/v1/persons?page=1&per_page=50&sort_by=id&order=asc") .get() .addHeader("Authorization", "Bearer <token>") .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = { method: 'GET', url: 'https://your-instance.seventhings.com/customer-api/v1/persons', params: {page: '1', per_page: '50', sort_by: 'id', order: 'asc'}, headers: {Authorization: 'Bearer <token>'}};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://your-instance.seventhings.com/customer-api/v1/persons?page=1&per_page=50&sort_by=id&order=asc';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}val client = OkHttpClient()
val request = Request.Builder() .url("https://your-instance.seventhings.com/customer-api/v1/persons?page=1&per_page=50&sort_by=id&order=asc") .get() .addHeader("Authorization", "Bearer <token>") .build()
val response = client.newCall(request).execute()<?php
$curl = curl_init();
curl_setopt_array($curl, [ CURLOPT_URL => "https://your-instance.seventhings.com/customer-api/v1/persons?page=1&per_page=50&sort_by=id&order=asc", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: Bearer <token>" ],]);
$response = curl_exec($curl);$err = curl_error($curl);
curl_close($curl);
if ($err) { echo "cURL Error #:" . $err;} else { echo $response;}<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-instance.seventhings.com/customer-api/v1/persons?page=1&per_page=50&sort_by=id&order=asc', [ 'headers' => [ 'Authorization' => 'Bearer <token>', ],]);
echo $response->getBody();import http.client
conn = http.client.HTTPSConnection("your-instance.seventhings.com")
headers = { 'Authorization': "Bearer <token>" }
conn.request("GET", "/customer-api/v1/persons?page=1&per_page=50&sort_by=id&order=asc", headers=headers)
res = conn.getresponse()data = res.read()
print(data.decode("utf-8"))import requests
url = "https://your-instance.seventhings.com/customer-api/v1/persons"
querystring = {"page":"1","per_page":"50","sort_by":"id","order":"asc"}
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())use reqwest;
#[tokio::main]pub async fn main() { let url = "https://your-instance.seventhings.com/customer-api/v1/persons";
let querystring = [ ("page", "1"), ("per_page", "50"), ("sort_by", "id"), ("order", "asc"), ];
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer <token>".parse().unwrap());
let client = reqwest::Client::new(); let response = client.get(url) .query(&querystring) .headers(headers) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request GET \ --url 'https://your-instance.seventhings.com/customer-api/v1/persons?page=1&per_page=50&sort_by=id&order=asc' \ --header 'Authorization: Bearer <token>'wget --quiet \ --method GET \ --header 'Authorization: Bearer <token>' \ --output-document \ - 'https://your-instance.seventhings.com/customer-api/v1/persons?page=1&per_page=50&sort_by=id&order=asc'Get the information about the persons.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”page
integer format: int32
Page number
Example
1per_page
integer format: int32
Number of items per page
Example
50sort_by
Sort by fieldkey.
string
Sort by
Example
idorder
string
Sort order direction
Example
ascResponses
Section titled “Responses”The information about the person currently logged in
Media typeapplication/json
object
items
Array<object>
object
fields
Fields defined in Template with its values, based on the type of the field. There is a difference with what can be send via POST/PUT/PATCH requests, and what will be returned via GET
This examples shows what data can be expected for ceraint field type:
POST/PUT/PATCH
{
"ATTACHMENT": "array<string (fileUuid)>",
"BARCODE": "string",
"DATE": "string (Y-m-d)",
"DATETIME": "string (Y-m-d\TH:i:sP)",
"DECIMAL": "decimal (1.23)",
"DROPDOWN": "string",
"LINK": "string",
"LINKED_ASSET": "int (asset id) | string (asset uuid)",
"LINKED_LOCATION": "int (location id) | string (location uuid)",
"LINKED_ROOM": "int (room id)| string (room uuid)",
"LINKED_USER": "int (user id)| string (user uuid)",
"LINKED_PERSON": "int (person id)| string (person uuid)",
"LONG_TEXT": "string",
"MONEY": "decimal (1.23)",
"NUMBER": "int (123)",
"REMINDER": "string (Y-m-d)",
"TEXT": "string",
}
GET
{
"ATTACHMENT": [
{
"uuid": "string (uuid)",
"type": "string",
"size": "int",
"data_uri": "string",
"file_uri": "string",
"thumbnail_uri": "string",
}
],
"BARCODE": "string",
"DATE": "string (Y-m-d)",
"DATETIME": "string (Y-m-d\TH:i:sP)",
"DECIMAL": "decimal (1.23)",
"DROPDOWN": "string",
"LINK": "string",
"LINKED_ASSET": {
"id": "int",
"uuid": "string (uuid)",
"display_name": "string"
},
"LINKED_LOCATION": {
"id": "int",
"uuid": "string (uuid)",
"display_name": "string"
},
"LINKED_ROOM": {
"id": "int",
"uuid": "string (uuid)",
"display_name": "string"
},
"LINKED_USER": {
"id": "int",
"uuid": "string (uuid)",
"display_name": "string"
},
"LINKED_PERSON": {
"id": "int",
"uuid": "string (uuid)",
"display_name": "string"
},
"LONG_TEXT": "string",
"MONEY": "decimal (1.23)",
"NUMBER": "int (123)",
"REMINDER": "string (Y-m-d)",
"TEXT": "string",
}
object
key
additional properties
any
page
integer format: int32
per_page
integer format: int32
sort_by
string
order
string
total
integer
Example
{ "items": [ { "fields": { "<field_key_1>": "<field_value_1>", "<field_key_2>": "<field_value_2>", "<field_key_3>": "<field_value_3>" } } ], "page": 1, "per_page": 50, "sort_by": "id", "order": "asc"}Access token is missing or invalid.
You are not permitted to perform the requested operation.
Internal Server Error.

