create a sub-resource state for a resource
curl --request POST \
--url https://b.anny.co/api/v1/service-sub-resources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "service-sub-resources",
"attributes": {
"is_required": false
},
"relationships": {
"resource": {
"data": {
"id": "21886",
"type": "resources"
}
}
},
"meta": {}
}
}
'import requests
url = "https://b.anny.co/api/v1/service-sub-resources"
payload = { "data": {
"type": "service-sub-resources",
"attributes": { "is_required": False },
"relationships": { "resource": { "data": {
"id": "21886",
"type": "resources"
} } },
"meta": {}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
type: 'service-sub-resources',
attributes: {is_required: false},
relationships: {resource: {data: {id: '21886', type: 'resources'}}},
meta: {}
}
})
};
fetch('https://b.anny.co/api/v1/service-sub-resources', 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://b.anny.co/api/v1/service-sub-resources",
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([
'data' => [
'type' => 'service-sub-resources',
'attributes' => [
'is_required' => false
],
'relationships' => [
'resource' => [
'data' => [
'id' => '21886',
'type' => 'resources'
]
]
],
'meta' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/vnd.api+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://b.anny.co/api/v1/service-sub-resources"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"service-sub-resources\",\n \"attributes\": {\n \"is_required\": false\n },\n \"relationships\": {\n \"resource\": {\n \"data\": {\n \"id\": \"21886\",\n \"type\": \"resources\"\n }\n }\n },\n \"meta\": {}\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/vnd.api+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://b.anny.co/api/v1/service-sub-resources")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"type\": \"service-sub-resources\",\n \"attributes\": {\n \"is_required\": false\n },\n \"relationships\": {\n \"resource\": {\n \"data\": {\n \"id\": \"21886\",\n \"type\": \"resources\"\n }\n }\n },\n \"meta\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.anny.co/api/v1/service-sub-resources")
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/vnd.api+json'
request.body = "{\n \"data\": {\n \"type\": \"service-sub-resources\",\n \"attributes\": {\n \"is_required\": false\n },\n \"relationships\": {\n \"resource\": {\n \"data\": {\n \"id\": \"21886\",\n \"type\": \"resources\"\n }\n }\n },\n \"meta\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"type": "service-sub-resources",
"id": "1434",
"attributes": {
"is_required": false
},
"relationships": {
"resource": {
"data": {
"type": "resources",
"id": "21886"
}
}
},
"links": {
"self": "https://b.anny.co/api/v1/service-sub-resources/1436"
}
},
"included": [
{
"type": "resources",
"id": "21886",
"attributes": {
"slug": "m01",
"name": "M01 - Aachen",
"description": "<p>Testbeschreibung</p>",
"plain_description": "Testbeschreibung",
"availabilityMode": null,
"continuous": false,
"color": null,
"auto_accept_bookings": true,
"timezone": "Europe/Berlin",
"quantity": 1,
"staggered_quantity": null,
"max_booking_quantity": 1,
"has_children": false,
"available_from": null,
"available_to": null,
"created_at": "2021-09-15T09:48:15+00:00",
"seo": true,
"live": true,
"public_listing": true,
"display_public_description": false,
"hidden": false,
"settings": {
"showAvailabilityCalendar": true,
"showAvailabilityCount": true,
"checkIn": {
"isEnabled": false,
"autoExpiry": false,
"autoExpiresAfter": 15,
"allowedAdvancePeriod": 15,
"allowedDelayPeriod": 30,
"allowMultiple": false,
"releaseOnCheckout": false
},
"printLabels": false,
"checkout": {
"customerCanPickChildren": false,
"requiresLogin": false,
"requiresLoginReason": "",
"verifyGuestEmail": false
},
"resources": {
"maxBookings": {
"perDay": null,
"perWeek": null,
"perMonth": null
}
},
"maxBookings": {
"perSlot": null,
"perDay": null,
"perWeek": null,
"perMonth": null
},
"selfCheckIn": {
"isEnabled": false,
"disabledUntil": 15,
"geoCheckEnabled": true,
"geoCheckMaxDelta": 997,
"allowedOverrunTime": 60
}
},
"preview_token": "ktlLeS7TseEXf8ZIE6WhWhFbITep9K",
"email_info": null
},
"meta": {
"settings": {
"showAvailabilityCalendar": true,
"showAvailabilityCount": true,
"checkout": {
"customerCanPickChildren": false,
"requiresLogin": false,
"requiresLoginReason": "",
"verifyGuestEmail": false
},
"checkIn": {
"isEnabled": false
},
"selfCheckIn": {
"isEnabled": false,
"disabledUntil": 15,
"geoCheckEnabled": true,
"geoCheckMaxDelta": 997,
"allowedOverrunTime": 60
}
},
"meta_settings": {
"showAvailabilityCalendar": true,
"showAvailabilityCount": true,
"checkout": {
"customerCanPickChildren": false,
"requiresLogin": false,
"requiresLoginReason": "",
"verifyGuestEmail": false
},
"checkIn": {
"isEnabled": false
},
"selfCheckIn": {
"isEnabled": false,
"disabledUntil": 15,
"geoCheckEnabled": true,
"geoCheckMaxDelta": 997,
"allowedOverrunTime": 60
}
},
"zoom": false
}
}
]
}Resource Management
create a sub-resource state for a resource
POST
/
api
/
v1
/
service-sub-resources
create a sub-resource state for a resource
curl --request POST \
--url https://b.anny.co/api/v1/service-sub-resources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "service-sub-resources",
"attributes": {
"is_required": false
},
"relationships": {
"resource": {
"data": {
"id": "21886",
"type": "resources"
}
}
},
"meta": {}
}
}
'import requests
url = "https://b.anny.co/api/v1/service-sub-resources"
payload = { "data": {
"type": "service-sub-resources",
"attributes": { "is_required": False },
"relationships": { "resource": { "data": {
"id": "21886",
"type": "resources"
} } },
"meta": {}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
type: 'service-sub-resources',
attributes: {is_required: false},
relationships: {resource: {data: {id: '21886', type: 'resources'}}},
meta: {}
}
})
};
fetch('https://b.anny.co/api/v1/service-sub-resources', 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://b.anny.co/api/v1/service-sub-resources",
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([
'data' => [
'type' => 'service-sub-resources',
'attributes' => [
'is_required' => false
],
'relationships' => [
'resource' => [
'data' => [
'id' => '21886',
'type' => 'resources'
]
]
],
'meta' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/vnd.api+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://b.anny.co/api/v1/service-sub-resources"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"service-sub-resources\",\n \"attributes\": {\n \"is_required\": false\n },\n \"relationships\": {\n \"resource\": {\n \"data\": {\n \"id\": \"21886\",\n \"type\": \"resources\"\n }\n }\n },\n \"meta\": {}\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/vnd.api+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://b.anny.co/api/v1/service-sub-resources")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"type\": \"service-sub-resources\",\n \"attributes\": {\n \"is_required\": false\n },\n \"relationships\": {\n \"resource\": {\n \"data\": {\n \"id\": \"21886\",\n \"type\": \"resources\"\n }\n }\n },\n \"meta\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.anny.co/api/v1/service-sub-resources")
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/vnd.api+json'
request.body = "{\n \"data\": {\n \"type\": \"service-sub-resources\",\n \"attributes\": {\n \"is_required\": false\n },\n \"relationships\": {\n \"resource\": {\n \"data\": {\n \"id\": \"21886\",\n \"type\": \"resources\"\n }\n }\n },\n \"meta\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"type": "service-sub-resources",
"id": "1434",
"attributes": {
"is_required": false
},
"relationships": {
"resource": {
"data": {
"type": "resources",
"id": "21886"
}
}
},
"links": {
"self": "https://b.anny.co/api/v1/service-sub-resources/1436"
}
},
"included": [
{
"type": "resources",
"id": "21886",
"attributes": {
"slug": "m01",
"name": "M01 - Aachen",
"description": "<p>Testbeschreibung</p>",
"plain_description": "Testbeschreibung",
"availabilityMode": null,
"continuous": false,
"color": null,
"auto_accept_bookings": true,
"timezone": "Europe/Berlin",
"quantity": 1,
"staggered_quantity": null,
"max_booking_quantity": 1,
"has_children": false,
"available_from": null,
"available_to": null,
"created_at": "2021-09-15T09:48:15+00:00",
"seo": true,
"live": true,
"public_listing": true,
"display_public_description": false,
"hidden": false,
"settings": {
"showAvailabilityCalendar": true,
"showAvailabilityCount": true,
"checkIn": {
"isEnabled": false,
"autoExpiry": false,
"autoExpiresAfter": 15,
"allowedAdvancePeriod": 15,
"allowedDelayPeriod": 30,
"allowMultiple": false,
"releaseOnCheckout": false
},
"printLabels": false,
"checkout": {
"customerCanPickChildren": false,
"requiresLogin": false,
"requiresLoginReason": "",
"verifyGuestEmail": false
},
"resources": {
"maxBookings": {
"perDay": null,
"perWeek": null,
"perMonth": null
}
},
"maxBookings": {
"perSlot": null,
"perDay": null,
"perWeek": null,
"perMonth": null
},
"selfCheckIn": {
"isEnabled": false,
"disabledUntil": 15,
"geoCheckEnabled": true,
"geoCheckMaxDelta": 997,
"allowedOverrunTime": 60
}
},
"preview_token": "ktlLeS7TseEXf8ZIE6WhWhFbITep9K",
"email_info": null
},
"meta": {
"settings": {
"showAvailabilityCalendar": true,
"showAvailabilityCount": true,
"checkout": {
"customerCanPickChildren": false,
"requiresLogin": false,
"requiresLoginReason": "",
"verifyGuestEmail": false
},
"checkIn": {
"isEnabled": false
},
"selfCheckIn": {
"isEnabled": false,
"disabledUntil": 15,
"geoCheckEnabled": true,
"geoCheckMaxDelta": 997,
"allowedOverrunTime": 60
}
},
"meta_settings": {
"showAvailabilityCalendar": true,
"showAvailabilityCount": true,
"checkout": {
"customerCanPickChildren": false,
"requiresLogin": false,
"requiresLoginReason": "",
"verifyGuestEmail": false
},
"checkIn": {
"isEnabled": false
},
"selfCheckIn": {
"isEnabled": false,
"disabledUntil": 15,
"geoCheckEnabled": true,
"geoCheckMaxDelta": 997,
"allowedOverrunTime": 60
}
},
"zoom": false
}
}
]
}Autorisierungen
The access token received from the authorization server in the OAuth 2.0 flow.
Body
application/vnd.api+json
Show child attributes
Show child attributes
Antwort
Created
A sub-resource assignment for a service, enabling multi-resource bookings.
Show child attributes
Show child attributes
⌘I