curl --request POST \
--url https://api.exowpee.com/v1/catalog/location-restrictions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"asset_ids": [
"<string>"
],
"agent_id": "<string>",
"user_profile_id": "<string>"
}
'import requests
url = "https://api.exowpee.com/v1/catalog/location-restrictions"
payload = {
"asset_ids": ["<string>"],
"agent_id": "<string>",
"user_profile_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({asset_ids: ['<string>'], agent_id: '<string>', user_profile_id: '<string>'})
};
fetch('https://api.exowpee.com/v1/catalog/location-restrictions', 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.exowpee.com/v1/catalog/location-restrictions",
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([
'asset_ids' => [
'<string>'
],
'agent_id' => '<string>',
'user_profile_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.exowpee.com/v1/catalog/location-restrictions"
payload := strings.NewReader("{\n \"asset_ids\": [\n \"<string>\"\n ],\n \"agent_id\": \"<string>\",\n \"user_profile_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.exowpee.com/v1/catalog/location-restrictions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"asset_ids\": [\n \"<string>\"\n ],\n \"agent_id\": \"<string>\",\n \"user_profile_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/location-restrictions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"asset_ids\": [\n \"<string>\"\n ],\n \"agent_id\": \"<string>\",\n \"user_profile_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"asset_id": "<string>",
"company_id": "<string>",
"restrictable_type": "<string>",
"restrictable_id": "<string>",
"asset": {},
"deleted_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]{
"message": "<string>",
"errors": {}
}Bar a member from locations
Bars an agent account or a user profile of the current company from using the listed locations. The locations then count as not eligible (reason restricted) for that person in the location eligibility checks. Answers with the created restrictions.
curl --request POST \
--url https://api.exowpee.com/v1/catalog/location-restrictions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"asset_ids": [
"<string>"
],
"agent_id": "<string>",
"user_profile_id": "<string>"
}
'import requests
url = "https://api.exowpee.com/v1/catalog/location-restrictions"
payload = {
"asset_ids": ["<string>"],
"agent_id": "<string>",
"user_profile_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({asset_ids: ['<string>'], agent_id: '<string>', user_profile_id: '<string>'})
};
fetch('https://api.exowpee.com/v1/catalog/location-restrictions', 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.exowpee.com/v1/catalog/location-restrictions",
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([
'asset_ids' => [
'<string>'
],
'agent_id' => '<string>',
'user_profile_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.exowpee.com/v1/catalog/location-restrictions"
payload := strings.NewReader("{\n \"asset_ids\": [\n \"<string>\"\n ],\n \"agent_id\": \"<string>\",\n \"user_profile_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.exowpee.com/v1/catalog/location-restrictions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"asset_ids\": [\n \"<string>\"\n ],\n \"agent_id\": \"<string>\",\n \"user_profile_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/location-restrictions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"asset_ids\": [\n \"<string>\"\n ],\n \"agent_id\": \"<string>\",\n \"user_profile_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"asset_id": "<string>",
"company_id": "<string>",
"restrictable_type": "<string>",
"restrictable_id": "<string>",
"asset": {},
"deleted_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]{
"message": "<string>",
"errors": {}
}asset_restrictions_locations.create
Conditions
- Exactly one of agent_id or user_profile_id must be sent; sending both is refused.
- The agent account or user profile must belong to the current company.
- asset_ids must hold at least one identifier, without duplicates.
- Every location must exist in the current organization, be of type location, not be deleted, and be shared with the current company.
- The call is refused as a whole when the person is already restricted on any of the listed locations; no restriction is created in that case. A restriction that was lifted earlier does not count.
- Either all the restrictions are created or none.
- Each listed location becomes not eligible (reason restricted) for that person within the current company wherever location eligibility is checked.
- No stock, accounting or notification change.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Response mode. Default none; none answers 204 No Content.
none, resource Comma-separated JSON keys of the root resource (id is always rendered). Available: id, asset_id, company_id, restrictable_type, restrictable_id, deleted_at, created_at, updated_at.
Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: asset.
Body
Identifiers of the locations (27-character KSUID strings). At least one, without duplicates. Each must be an existing location of the organization shared with the current company; on creation none may already be restricted for that person, on lifting each must currently be restricted.
127Identifier of the company agent account to restrict (27-character KSUID string). Required when user_profile_id is not sent; refused when user_profile_id is sent. The agent account must belong to the current company.
27Identifier of the user profile (a member's assignment in the current company) to restrict (27-character KSUID string). Required when agent_id is not sent. It must belong to the current company.
27Response
Resource (only with response=resource).
Identifier of the restriction (27-character KSUID string).
Identifier of the location the person is barred from (27-character KSUID string).
Identifier of the company the record belongs to.
Kind of person restricted: agent account (a company agent account) or user_profile (a member's profile assignment in the company).
Identifier of the restricted agent account or user profile (27-character KSUID string).
Short location (id, name, type). Only rendered when requested with the include parameter.
Date and time the restriction was lifted (ISO 8601); null for an active restriction. Lists and creation only return active ones.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).