Get count of all objects.
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/objects/count?filter=%7B%22%3Cfilter_id%3E%22%3A%22%3Cfilter_name%3E%22%7D");
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/objects/count?filter=%7B%22%3Cfilter_id%3E%22%3A%22%3Cfilter_name%3E%22%7D"), 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/objects/count?filter=%7B%22%3Cfilter_id%3E%22%3A%22%3Cfilter_name%3E%22%7D"
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/objects/count?filter=%7B%22%3Cfilter_id%3E%22%3A%22%3Cfilter_name%3E%22%7D")) .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/objects/count?filter=%7B%22%3Cfilter_id%3E%22%3A%22%3Cfilter_name%3E%22%7D") .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/objects/count', params: {filter: '{"<filter_id>":"<filter_name>"}'}, 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/objects/count?filter=%7B%22%3Cfilter_id%3E%22%3A%22%3Cfilter_name%3E%22%7D';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/objects/count?filter=%7B%22%3Cfilter_id%3E%22%3A%22%3Cfilter_name%3E%22%7D") .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/objects/count?filter=%7B%22%3Cfilter_id%3E%22%3A%22%3Cfilter_name%3E%22%7D", 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/objects/count?filter=%7B%22%3Cfilter_id%3E%22%3A%22%3Cfilter_name%3E%22%7D', [ '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/objects/count?filter=%7B%22%3Cfilter_id%3E%22%3A%22%3Cfilter_name%3E%22%7D", headers=headers)
res = conn.getresponse()data = res.read()
print(data.decode("utf-8"))import requests
url = "https://your-instance.seventhings.com/customer-api/v1/objects/count"
querystring = {"filter":"{\"<filter_id>\":\"<filter_name>\"}"}
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/objects/count";
let querystring = [ ("filter", "{"<filter_id>":"<filter_name>"}"), ];
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/objects/count?filter=%7B%22%3Cfilter_id%3E%22%3A%22%3Cfilter_name%3E%22%7D' \ --header 'Authorization: Bearer <token>'wget --quiet \ --method GET \ --header 'Authorization: Bearer <token>' \ --output-document \ - 'https://your-instance.seventhings.com/customer-api/v1/objects/count?filter=%7B%22%3Cfilter_id%3E%22%3A%22%3Cfilter_name%3E%22%7D'Get count of all objects.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Fields are defined in Template, so this examples are based on the type of the field,
not on the FieldKey
The filter parameter is a deep object, which means that it can have multiple levels of nesting.
In the first level there is the field name, in the second level there is the operator and
in the third level there are the values or the value.
for example: filter[TEXT][eq]='exact searched text'
The exact field name you can find in the field definition list of your customer instance.
The known operators which can be used for one value per field you can find here:
eqwhich is used for exact matchneqwhich is used for the opposite of an exact matchgtwhich is used for a greater than matchgt_or_nullwhich is used for a greater than match or nullgtewhich is used for a greater than or equal matchgte_or_nullwhich is used for a greater than or equal match or nullltwhich is used for a less than matchlt_or_nullwhich is used for a less than match or nullltewhich is used for a less than or equal matchlte_or_nullwhich is used for a less than or equal match or null
Here is the list of the known operators which can be used for multiple values per field:
likewhich is used for a partial matchnot_likewhich is used for a partial mismatchinwhich is used for a list of exact matchesninwhich is used for a list of the opposite of exact matches
Here are some examples:
filter[TEXT][eq]='exact searched text'filter[TEXT][neq]='exact searched text'filter[TEXT][like][]='searched text'filter[TEXT][not_like][]='searched text'filter[TEXT][in][]='searched text'filter[TEXT][nin][]='searched text'filter[DATE][gt]=2022-11-15filter[DATE][gt_or_null]=2022-11-15filter[DATE][gte]=2022-11-15filter[DATE][gte_or_null]=2022-11-15filter[DATE][lt]=2022-11-15&filter[DATE][gt]=2022-11-14filter[DATE][lt_or_null]=2022-11-15&filter[DATE][gt]=2022-11-14filter[DATE][lte]=2022-11-15&filter[DATE][gt]=2022-11-14filter[DATE][lte_or_null]=2022-11-15&filter[DATE][gt]=2022-11-14filter[DATETIME][gt]=2022-11-15+00:00:00filter[DATETIME][lt]=2022-11-15+00:00:00&filter[DATETIME][gt]=2022-11-14+00:00:00
object
Example
{ "<filter_id>": "<filter_name>"}Responses
Section titled “Responses”Success
object
Examplegenerated
{ "count": 1}Request body is missing or invalid or request data is invalid.
Access token is missing or invalid.
You are not permitted to perform the requested operation.
The requested resource could not be found.
The requested resource representation has no acceptable format.
The requested entry is not processable.
Internal Server Error.

