curl --request POST \
--url https://api.apsio.io/v1/orgs/{orgId}/projects/{projectId}/device-requests \
--header 'Content-Type: application/json' \
--cookie apsio_session= \
--data '
{
"subject": "<string>",
"families": [],
"days": 4
}
'import requests
url = "https://api.apsio.io/v1/orgs/{orgId}/projects/{projectId}/device-requests"
payload = {
"subject": "<string>",
"families": [],
"days": 4
}
headers = {
"cookie": "apsio_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'apsio_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({subject: '<string>', families: [], days: 4})
};
fetch('https://api.apsio.io/v1/orgs/{orgId}/projects/{projectId}/device-requests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.apsio.io/v1/orgs/{orgId}/projects/{projectId}/device-requests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'subject' => '<string>',
'families' => [
],
'days' => 4
]),
CURLOPT_COOKIE => "apsio_session=",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.apsio.io/v1/orgs/{orgId}/projects/{projectId}/device-requests"
payload := strings.NewReader("{\n \"subject\": \"<string>\",\n \"families\": [],\n \"days\": 4\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "apsio_session=")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.apsio.io/v1/orgs/{orgId}/projects/{projectId}/device-requests")
.header("cookie", "apsio_session=")
.header("Content-Type", "application/json")
.body("{\n \"subject\": \"<string>\",\n \"families\": [],\n \"days\": 4\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apsio.io/v1/orgs/{orgId}/projects/{projectId}/device-requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'apsio_session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"subject\": \"<string>\",\n \"families\": [],\n \"days\": 4\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"project_id": "<string>",
"kind": "send",
"subject_kind": "install",
"subject_hint": "<string>",
"families": [
"summary"
],
"created_by": "<string>",
"created_at": "<string>",
"expires_at": "<string>",
"canceled_at": "<string>",
"state": "open"
}Ask a device to send or delete what it holds
Asks one install (by its app.installation.id) or one app user (by user.hash) of the project to send what its device holds, every family’s included, or to delete it (spec 15.5). The request goes into the policy of every app of the project for 1 to 7 days (7 by default), matched by a hash: the id or hash given here is never stored. At most 100 open per project (409 beyond). It never overrides a user’s consent or opt-out. Owners and admins; audited as device_request.create.
curl --request POST \
--url https://api.apsio.io/v1/orgs/{orgId}/projects/{projectId}/device-requests \
--header 'Content-Type: application/json' \
--cookie apsio_session= \
--data '
{
"subject": "<string>",
"families": [],
"days": 4
}
'import requests
url = "https://api.apsio.io/v1/orgs/{orgId}/projects/{projectId}/device-requests"
payload = {
"subject": "<string>",
"families": [],
"days": 4
}
headers = {
"cookie": "apsio_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'apsio_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({subject: '<string>', families: [], days: 4})
};
fetch('https://api.apsio.io/v1/orgs/{orgId}/projects/{projectId}/device-requests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.apsio.io/v1/orgs/{orgId}/projects/{projectId}/device-requests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'subject' => '<string>',
'families' => [
],
'days' => 4
]),
CURLOPT_COOKIE => "apsio_session=",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.apsio.io/v1/orgs/{orgId}/projects/{projectId}/device-requests"
payload := strings.NewReader("{\n \"subject\": \"<string>\",\n \"families\": [],\n \"days\": 4\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "apsio_session=")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.apsio.io/v1/orgs/{orgId}/projects/{projectId}/device-requests")
.header("cookie", "apsio_session=")
.header("Content-Type", "application/json")
.body("{\n \"subject\": \"<string>\",\n \"families\": [],\n \"days\": 4\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apsio.io/v1/orgs/{orgId}/projects/{projectId}/device-requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'apsio_session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"subject\": \"<string>\",\n \"families\": [],\n \"days\": 4\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"project_id": "<string>",
"kind": "send",
"subject_kind": "install",
"subject_hint": "<string>",
"families": [
"summary"
],
"created_by": "<string>",
"created_at": "<string>",
"expires_at": "<string>",
"canceled_at": "<string>",
"state": "open"
}Authorizations
The console session, set by /v1/auth/callback (__Host-apsio_session when host-only).
Path Parameters
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"0192f3a4-0000-7000-8000-00000000a001"
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"0192f3a4-0000-7000-8000-00000000a001"
Body
send, delete install, user The app.installation.id or the user.hash.
1 - 2561summary, errors, logs, spans, network, metrics, replay 1 <= x <= 7Response
The request
send, delete install, user The install id's or user hash's last four characters.
Null: every family.
summary, errors, logs, spans, network, metrics, replay Open: in the policy every device of the project fetches.
open, expired, canceled