Create or update a connection
curl --request POST \
--url https://b.anny.co/api/connections/save \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connectedPerson": {
"id": "93633dd1-1399-40df-8536-9972f41ee71c",
"email": "david.bowie@example.com"
},
"permittedScopes": {
"read_bookings": "granted",
"edit_bookings": "declined",
"book_on_behalf": "declined",
"receive_notifications": "declined"
},
"accessibleScopes": {
"read_bookings": "requested",
"edit_bookings": "declined",
"book_on_behalf": "declined",
"receive_notifications": "declined"
}
}
'import requests
url = "https://b.anny.co/api/connections/save"
payload = {
"connectedPerson": {
"id": "93633dd1-1399-40df-8536-9972f41ee71c",
"email": "david.bowie@example.com"
},
"permittedScopes": {
"read_bookings": "granted",
"edit_bookings": "declined",
"book_on_behalf": "declined",
"receive_notifications": "declined"
},
"accessibleScopes": {
"read_bookings": "requested",
"edit_bookings": "declined",
"book_on_behalf": "declined",
"receive_notifications": "declined"
}
}
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({
connectedPerson: {id: '93633dd1-1399-40df-8536-9972f41ee71c', email: 'david.bowie@example.com'},
permittedScopes: {
read_bookings: 'granted',
edit_bookings: 'declined',
book_on_behalf: 'declined',
receive_notifications: 'declined'
},
accessibleScopes: {
read_bookings: 'requested',
edit_bookings: 'declined',
book_on_behalf: 'declined',
receive_notifications: 'declined'
}
})
};
fetch('https://b.anny.co/api/connections/save', 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/connections/save",
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([
'connectedPerson' => [
'id' => '93633dd1-1399-40df-8536-9972f41ee71c',
'email' => 'david.bowie@example.com'
],
'permittedScopes' => [
'read_bookings' => 'granted',
'edit_bookings' => 'declined',
'book_on_behalf' => 'declined',
'receive_notifications' => 'declined'
],
'accessibleScopes' => [
'read_bookings' => 'requested',
'edit_bookings' => 'declined',
'book_on_behalf' => 'declined',
'receive_notifications' => 'declined'
]
]),
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://b.anny.co/api/connections/save"
payload := strings.NewReader("{\n \"connectedPerson\": {\n \"id\": \"93633dd1-1399-40df-8536-9972f41ee71c\",\n \"email\": \"david.bowie@example.com\"\n },\n \"permittedScopes\": {\n \"read_bookings\": \"granted\",\n \"edit_bookings\": \"declined\",\n \"book_on_behalf\": \"declined\",\n \"receive_notifications\": \"declined\"\n },\n \"accessibleScopes\": {\n \"read_bookings\": \"requested\",\n \"edit_bookings\": \"declined\",\n \"book_on_behalf\": \"declined\",\n \"receive_notifications\": \"declined\"\n }\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://b.anny.co/api/connections/save")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connectedPerson\": {\n \"id\": \"93633dd1-1399-40df-8536-9972f41ee71c\",\n \"email\": \"david.bowie@example.com\"\n },\n \"permittedScopes\": {\n \"read_bookings\": \"granted\",\n \"edit_bookings\": \"declined\",\n \"book_on_behalf\": \"declined\",\n \"receive_notifications\": \"declined\"\n },\n \"accessibleScopes\": {\n \"read_bookings\": \"requested\",\n \"edit_bookings\": \"declined\",\n \"book_on_behalf\": \"declined\",\n \"receive_notifications\": \"declined\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.anny.co/api/connections/save")
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 \"connectedPerson\": {\n \"id\": \"93633dd1-1399-40df-8536-9972f41ee71c\",\n \"email\": \"david.bowie@example.com\"\n },\n \"permittedScopes\": {\n \"read_bookings\": \"granted\",\n \"edit_bookings\": \"declined\",\n \"book_on_behalf\": \"declined\",\n \"receive_notifications\": \"declined\"\n },\n \"accessibleScopes\": {\n \"read_bookings\": \"requested\",\n \"edit_bookings\": \"declined\",\n \"book_on_behalf\": \"declined\",\n \"receive_notifications\": \"declined\"\n }\n}"
response = http.request(request)
puts response.read_bodyConnected Persons
Create or update a connection
Create a new connection or update an existing one between the authenticated customer and another person. The backend determines whether this is a new connection or an update based on the connectedPerson identity.
Scopes:
permittedScopes— scopes you grant to the other person. Values:grantedordeclinedaccessibleScopes— scopes you request from the other person. Values:requestedordeclined. These becomegrantedonce accepted by the other user.
Provide either the id (UUID) or email of the connected person — or both. If the email is not yet registered, an invitation to create an anny account is sent.
POST
/
api
/
connections
/
save
Create or update a connection
curl --request POST \
--url https://b.anny.co/api/connections/save \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connectedPerson": {
"id": "93633dd1-1399-40df-8536-9972f41ee71c",
"email": "david.bowie@example.com"
},
"permittedScopes": {
"read_bookings": "granted",
"edit_bookings": "declined",
"book_on_behalf": "declined",
"receive_notifications": "declined"
},
"accessibleScopes": {
"read_bookings": "requested",
"edit_bookings": "declined",
"book_on_behalf": "declined",
"receive_notifications": "declined"
}
}
'import requests
url = "https://b.anny.co/api/connections/save"
payload = {
"connectedPerson": {
"id": "93633dd1-1399-40df-8536-9972f41ee71c",
"email": "david.bowie@example.com"
},
"permittedScopes": {
"read_bookings": "granted",
"edit_bookings": "declined",
"book_on_behalf": "declined",
"receive_notifications": "declined"
},
"accessibleScopes": {
"read_bookings": "requested",
"edit_bookings": "declined",
"book_on_behalf": "declined",
"receive_notifications": "declined"
}
}
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({
connectedPerson: {id: '93633dd1-1399-40df-8536-9972f41ee71c', email: 'david.bowie@example.com'},
permittedScopes: {
read_bookings: 'granted',
edit_bookings: 'declined',
book_on_behalf: 'declined',
receive_notifications: 'declined'
},
accessibleScopes: {
read_bookings: 'requested',
edit_bookings: 'declined',
book_on_behalf: 'declined',
receive_notifications: 'declined'
}
})
};
fetch('https://b.anny.co/api/connections/save', 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/connections/save",
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([
'connectedPerson' => [
'id' => '93633dd1-1399-40df-8536-9972f41ee71c',
'email' => 'david.bowie@example.com'
],
'permittedScopes' => [
'read_bookings' => 'granted',
'edit_bookings' => 'declined',
'book_on_behalf' => 'declined',
'receive_notifications' => 'declined'
],
'accessibleScopes' => [
'read_bookings' => 'requested',
'edit_bookings' => 'declined',
'book_on_behalf' => 'declined',
'receive_notifications' => 'declined'
]
]),
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://b.anny.co/api/connections/save"
payload := strings.NewReader("{\n \"connectedPerson\": {\n \"id\": \"93633dd1-1399-40df-8536-9972f41ee71c\",\n \"email\": \"david.bowie@example.com\"\n },\n \"permittedScopes\": {\n \"read_bookings\": \"granted\",\n \"edit_bookings\": \"declined\",\n \"book_on_behalf\": \"declined\",\n \"receive_notifications\": \"declined\"\n },\n \"accessibleScopes\": {\n \"read_bookings\": \"requested\",\n \"edit_bookings\": \"declined\",\n \"book_on_behalf\": \"declined\",\n \"receive_notifications\": \"declined\"\n }\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://b.anny.co/api/connections/save")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connectedPerson\": {\n \"id\": \"93633dd1-1399-40df-8536-9972f41ee71c\",\n \"email\": \"david.bowie@example.com\"\n },\n \"permittedScopes\": {\n \"read_bookings\": \"granted\",\n \"edit_bookings\": \"declined\",\n \"book_on_behalf\": \"declined\",\n \"receive_notifications\": \"declined\"\n },\n \"accessibleScopes\": {\n \"read_bookings\": \"requested\",\n \"edit_bookings\": \"declined\",\n \"book_on_behalf\": \"declined\",\n \"receive_notifications\": \"declined\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.anny.co/api/connections/save")
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 \"connectedPerson\": {\n \"id\": \"93633dd1-1399-40df-8536-9972f41ee71c\",\n \"email\": \"david.bowie@example.com\"\n },\n \"permittedScopes\": {\n \"read_bookings\": \"granted\",\n \"edit_bookings\": \"declined\",\n \"book_on_behalf\": \"declined\",\n \"receive_notifications\": \"declined\"\n },\n \"accessibleScopes\": {\n \"read_bookings\": \"requested\",\n \"edit_bookings\": \"declined\",\n \"book_on_behalf\": \"declined\",\n \"receive_notifications\": \"declined\"\n }\n}"
response = http.request(request)
puts response.read_bodyAutorisierungen
The access token received from the authorization server in the OAuth 2.0 flow.
Header
Bearer Token
Body
application/json
Antwort
OK
⌘I