Create a plan
curl --request POST \
--url https://api.spacebring.com/plans/v1 \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"plan": {
"locationRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price": 1,
"title": "<string>",
"access": {
"avigilonAltaGroupRef": 123,
"brivoGroupRef": 123,
"kisiGroupRef": 123,
"saltoksAccessGroupRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tapkeyGroupRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"addons": [],
"commitmentCycles": 0,
"credits": 0,
"customTax": {
"enabled": false,
"rate": 0
},
"dayPasses": 0,
"description": "",
"discounts": {
"creditPackages": 0,
"desks": 0,
"equipment": 0,
"events": 0,
"rooms": 0,
"shop": 0
},
"exclusiveAccess": {
"resourceRefs": []
},
"grantedDiscounts": [
{
"coupon": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amountOff": 123,
"currencyCode": "<string>",
"percentOff": 123,
"productTypes": []
}
}
],
"printing": {
"ezeepBlueGroupRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"selfSignup": {
"enabled": false,
"type": "immediate"
},
"setupFee": 0
}
}
'import requests
url = "https://api.spacebring.com/plans/v1"
payload = { "plan": {
"locationRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price": 1,
"title": "<string>",
"access": {
"avigilonAltaGroupRef": 123,
"brivoGroupRef": 123,
"kisiGroupRef": 123,
"saltoksAccessGroupRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tapkeyGroupRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"addons": [],
"commitmentCycles": 0,
"credits": 0,
"customTax": {
"enabled": False,
"rate": 0
},
"dayPasses": 0,
"description": "",
"discounts": {
"creditPackages": 0,
"desks": 0,
"equipment": 0,
"events": 0,
"rooms": 0,
"shop": 0
},
"exclusiveAccess": { "resourceRefs": [] },
"grantedDiscounts": [{ "coupon": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amountOff": 123,
"currencyCode": "<string>",
"percentOff": 123,
"productTypes": []
} }],
"printing": { "ezeepBlueGroupRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a" },
"selfSignup": {
"enabled": False,
"type": "immediate"
},
"setupFee": 0
} }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
plan: {
locationRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
price: 1,
title: '<string>',
access: {
avigilonAltaGroupRef: 123,
brivoGroupRef: 123,
kisiGroupRef: 123,
saltoksAccessGroupRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
tapkeyGroupRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
},
addons: [],
commitmentCycles: 0,
credits: 0,
customTax: {enabled: false, rate: 0},
dayPasses: 0,
description: '',
discounts: {creditPackages: 0, desks: 0, equipment: 0, events: 0, rooms: 0, shop: 0},
exclusiveAccess: {resourceRefs: []},
grantedDiscounts: [
{
coupon: {
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
amountOff: 123,
currencyCode: '<string>',
percentOff: 123,
productTypes: []
}
}
],
printing: {ezeepBlueGroupRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a'},
selfSignup: {enabled: false, type: 'immediate'},
setupFee: 0
}
})
};
fetch('https://api.spacebring.com/plans/v1', 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.spacebring.com/plans/v1",
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([
'plan' => [
'locationRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'price' => 1,
'title' => '<string>',
'access' => [
'avigilonAltaGroupRef' => 123,
'brivoGroupRef' => 123,
'kisiGroupRef' => 123,
'saltoksAccessGroupRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'tapkeyGroupRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'addons' => [
],
'commitmentCycles' => 0,
'credits' => 0,
'customTax' => [
'enabled' => false,
'rate' => 0
],
'dayPasses' => 0,
'description' => '',
'discounts' => [
'creditPackages' => 0,
'desks' => 0,
'equipment' => 0,
'events' => 0,
'rooms' => 0,
'shop' => 0
],
'exclusiveAccess' => [
'resourceRefs' => [
]
],
'grantedDiscounts' => [
[
'coupon' => [
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'amountOff' => 123,
'currencyCode' => '<string>',
'percentOff' => 123,
'productTypes' => [
]
]
]
],
'printing' => [
'ezeepBlueGroupRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'selfSignup' => [
'enabled' => false,
'type' => 'immediate'
],
'setupFee' => 0
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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.spacebring.com/plans/v1"
payload := strings.NewReader("{\n \"plan\": {\n \"locationRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"price\": 1,\n \"title\": \"<string>\",\n \"access\": {\n \"avigilonAltaGroupRef\": 123,\n \"brivoGroupRef\": 123,\n \"kisiGroupRef\": 123,\n \"saltoksAccessGroupRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tapkeyGroupRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"addons\": [],\n \"commitmentCycles\": 0,\n \"credits\": 0,\n \"customTax\": {\n \"enabled\": false,\n \"rate\": 0\n },\n \"dayPasses\": 0,\n \"description\": \"\",\n \"discounts\": {\n \"creditPackages\": 0,\n \"desks\": 0,\n \"equipment\": 0,\n \"events\": 0,\n \"rooms\": 0,\n \"shop\": 0\n },\n \"exclusiveAccess\": {\n \"resourceRefs\": []\n },\n \"grantedDiscounts\": [\n {\n \"coupon\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amountOff\": 123,\n \"currencyCode\": \"<string>\",\n \"percentOff\": 123,\n \"productTypes\": []\n }\n }\n ],\n \"printing\": {\n \"ezeepBlueGroupRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"selfSignup\": {\n \"enabled\": false,\n \"type\": \"immediate\"\n },\n \"setupFee\": 0\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.spacebring.com/plans/v1")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"plan\": {\n \"locationRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"price\": 1,\n \"title\": \"<string>\",\n \"access\": {\n \"avigilonAltaGroupRef\": 123,\n \"brivoGroupRef\": 123,\n \"kisiGroupRef\": 123,\n \"saltoksAccessGroupRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tapkeyGroupRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"addons\": [],\n \"commitmentCycles\": 0,\n \"credits\": 0,\n \"customTax\": {\n \"enabled\": false,\n \"rate\": 0\n },\n \"dayPasses\": 0,\n \"description\": \"\",\n \"discounts\": {\n \"creditPackages\": 0,\n \"desks\": 0,\n \"equipment\": 0,\n \"events\": 0,\n \"rooms\": 0,\n \"shop\": 0\n },\n \"exclusiveAccess\": {\n \"resourceRefs\": []\n },\n \"grantedDiscounts\": [\n {\n \"coupon\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amountOff\": 123,\n \"currencyCode\": \"<string>\",\n \"percentOff\": 123,\n \"productTypes\": []\n }\n }\n ],\n \"printing\": {\n \"ezeepBlueGroupRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"selfSignup\": {\n \"enabled\": false,\n \"type\": \"immediate\"\n },\n \"setupFee\": 0\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spacebring.com/plans/v1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"plan\": {\n \"locationRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"price\": 1,\n \"title\": \"<string>\",\n \"access\": {\n \"avigilonAltaGroupRef\": 123,\n \"brivoGroupRef\": 123,\n \"kisiGroupRef\": 123,\n \"saltoksAccessGroupRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tapkeyGroupRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"addons\": [],\n \"commitmentCycles\": 0,\n \"credits\": 0,\n \"customTax\": {\n \"enabled\": false,\n \"rate\": 0\n },\n \"dayPasses\": 0,\n \"description\": \"\",\n \"discounts\": {\n \"creditPackages\": 0,\n \"desks\": 0,\n \"equipment\": 0,\n \"events\": 0,\n \"rooms\": 0,\n \"shop\": 0\n },\n \"exclusiveAccess\": {\n \"resourceRefs\": []\n },\n \"grantedDiscounts\": [\n {\n \"coupon\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amountOff\": 123,\n \"currencyCode\": \"<string>\",\n \"percentOff\": 123,\n \"productTypes\": []\n }\n }\n ],\n \"printing\": {\n \"ezeepBlueGroupRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"selfSignup\": {\n \"enabled\": false,\n \"type\": \"immediate\"\n },\n \"setupFee\": 0\n }\n}"
response = http.request(request)
puts response.read_body{
"plan": {
"addons": [],
"commitmentCycles": 123,
"createDate": "2023-11-07T05:31:56Z",
"credits": 123,
"customTax": {
"enabled": true,
"rate": 123
},
"dayPasses": 123,
"description": "<string>",
"discounts": {
"creditPackages": 123,
"desks": 123,
"equipment": 123,
"events": 123,
"rooms": 123,
"shop": 123
},
"exclusiveAccess": {
"resourceRefs": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"grantedDiscounts": [
{
"coupon": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amountOff": 123,
"currencyCode": "<string>",
"enabledForCredits": true,
"limitedItems": {
"enabled": true,
"values": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>"
}
]
},
"limitedRedemption": {
"enabled": true,
"usage": 123,
"value": 123
},
"percentOff": 123,
"productTypes": []
}
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locale": "<string>",
"locationRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price": 123,
"selfSignup": {
"enabled": true
},
"setupFee": 123,
"title": "<string>",
"access": {
"avigilonAltaGroupRef": 123,
"brivoGroupRef": 123,
"kisiGroupRef": 123,
"saltoksAccessGroupRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tapkeyGroupRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"printing": {
"ezeepBlueGroupRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
}{
"message": "<string>",
"type": "<string>"
}Plans
Create a plan
Create a plan.
OAuth
Required scopes:plansPOST
/
plans
/
v1
Create a plan
curl --request POST \
--url https://api.spacebring.com/plans/v1 \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"plan": {
"locationRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price": 1,
"title": "<string>",
"access": {
"avigilonAltaGroupRef": 123,
"brivoGroupRef": 123,
"kisiGroupRef": 123,
"saltoksAccessGroupRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tapkeyGroupRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"addons": [],
"commitmentCycles": 0,
"credits": 0,
"customTax": {
"enabled": false,
"rate": 0
},
"dayPasses": 0,
"description": "",
"discounts": {
"creditPackages": 0,
"desks": 0,
"equipment": 0,
"events": 0,
"rooms": 0,
"shop": 0
},
"exclusiveAccess": {
"resourceRefs": []
},
"grantedDiscounts": [
{
"coupon": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amountOff": 123,
"currencyCode": "<string>",
"percentOff": 123,
"productTypes": []
}
}
],
"printing": {
"ezeepBlueGroupRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"selfSignup": {
"enabled": false,
"type": "immediate"
},
"setupFee": 0
}
}
'import requests
url = "https://api.spacebring.com/plans/v1"
payload = { "plan": {
"locationRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price": 1,
"title": "<string>",
"access": {
"avigilonAltaGroupRef": 123,
"brivoGroupRef": 123,
"kisiGroupRef": 123,
"saltoksAccessGroupRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tapkeyGroupRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"addons": [],
"commitmentCycles": 0,
"credits": 0,
"customTax": {
"enabled": False,
"rate": 0
},
"dayPasses": 0,
"description": "",
"discounts": {
"creditPackages": 0,
"desks": 0,
"equipment": 0,
"events": 0,
"rooms": 0,
"shop": 0
},
"exclusiveAccess": { "resourceRefs": [] },
"grantedDiscounts": [{ "coupon": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amountOff": 123,
"currencyCode": "<string>",
"percentOff": 123,
"productTypes": []
} }],
"printing": { "ezeepBlueGroupRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a" },
"selfSignup": {
"enabled": False,
"type": "immediate"
},
"setupFee": 0
} }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
plan: {
locationRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
price: 1,
title: '<string>',
access: {
avigilonAltaGroupRef: 123,
brivoGroupRef: 123,
kisiGroupRef: 123,
saltoksAccessGroupRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
tapkeyGroupRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
},
addons: [],
commitmentCycles: 0,
credits: 0,
customTax: {enabled: false, rate: 0},
dayPasses: 0,
description: '',
discounts: {creditPackages: 0, desks: 0, equipment: 0, events: 0, rooms: 0, shop: 0},
exclusiveAccess: {resourceRefs: []},
grantedDiscounts: [
{
coupon: {
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
amountOff: 123,
currencyCode: '<string>',
percentOff: 123,
productTypes: []
}
}
],
printing: {ezeepBlueGroupRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a'},
selfSignup: {enabled: false, type: 'immediate'},
setupFee: 0
}
})
};
fetch('https://api.spacebring.com/plans/v1', 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.spacebring.com/plans/v1",
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([
'plan' => [
'locationRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'price' => 1,
'title' => '<string>',
'access' => [
'avigilonAltaGroupRef' => 123,
'brivoGroupRef' => 123,
'kisiGroupRef' => 123,
'saltoksAccessGroupRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'tapkeyGroupRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'addons' => [
],
'commitmentCycles' => 0,
'credits' => 0,
'customTax' => [
'enabled' => false,
'rate' => 0
],
'dayPasses' => 0,
'description' => '',
'discounts' => [
'creditPackages' => 0,
'desks' => 0,
'equipment' => 0,
'events' => 0,
'rooms' => 0,
'shop' => 0
],
'exclusiveAccess' => [
'resourceRefs' => [
]
],
'grantedDiscounts' => [
[
'coupon' => [
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'amountOff' => 123,
'currencyCode' => '<string>',
'percentOff' => 123,
'productTypes' => [
]
]
]
],
'printing' => [
'ezeepBlueGroupRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'selfSignup' => [
'enabled' => false,
'type' => 'immediate'
],
'setupFee' => 0
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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.spacebring.com/plans/v1"
payload := strings.NewReader("{\n \"plan\": {\n \"locationRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"price\": 1,\n \"title\": \"<string>\",\n \"access\": {\n \"avigilonAltaGroupRef\": 123,\n \"brivoGroupRef\": 123,\n \"kisiGroupRef\": 123,\n \"saltoksAccessGroupRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tapkeyGroupRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"addons\": [],\n \"commitmentCycles\": 0,\n \"credits\": 0,\n \"customTax\": {\n \"enabled\": false,\n \"rate\": 0\n },\n \"dayPasses\": 0,\n \"description\": \"\",\n \"discounts\": {\n \"creditPackages\": 0,\n \"desks\": 0,\n \"equipment\": 0,\n \"events\": 0,\n \"rooms\": 0,\n \"shop\": 0\n },\n \"exclusiveAccess\": {\n \"resourceRefs\": []\n },\n \"grantedDiscounts\": [\n {\n \"coupon\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amountOff\": 123,\n \"currencyCode\": \"<string>\",\n \"percentOff\": 123,\n \"productTypes\": []\n }\n }\n ],\n \"printing\": {\n \"ezeepBlueGroupRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"selfSignup\": {\n \"enabled\": false,\n \"type\": \"immediate\"\n },\n \"setupFee\": 0\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.spacebring.com/plans/v1")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"plan\": {\n \"locationRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"price\": 1,\n \"title\": \"<string>\",\n \"access\": {\n \"avigilonAltaGroupRef\": 123,\n \"brivoGroupRef\": 123,\n \"kisiGroupRef\": 123,\n \"saltoksAccessGroupRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tapkeyGroupRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"addons\": [],\n \"commitmentCycles\": 0,\n \"credits\": 0,\n \"customTax\": {\n \"enabled\": false,\n \"rate\": 0\n },\n \"dayPasses\": 0,\n \"description\": \"\",\n \"discounts\": {\n \"creditPackages\": 0,\n \"desks\": 0,\n \"equipment\": 0,\n \"events\": 0,\n \"rooms\": 0,\n \"shop\": 0\n },\n \"exclusiveAccess\": {\n \"resourceRefs\": []\n },\n \"grantedDiscounts\": [\n {\n \"coupon\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amountOff\": 123,\n \"currencyCode\": \"<string>\",\n \"percentOff\": 123,\n \"productTypes\": []\n }\n }\n ],\n \"printing\": {\n \"ezeepBlueGroupRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"selfSignup\": {\n \"enabled\": false,\n \"type\": \"immediate\"\n },\n \"setupFee\": 0\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spacebring.com/plans/v1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"plan\": {\n \"locationRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"price\": 1,\n \"title\": \"<string>\",\n \"access\": {\n \"avigilonAltaGroupRef\": 123,\n \"brivoGroupRef\": 123,\n \"kisiGroupRef\": 123,\n \"saltoksAccessGroupRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tapkeyGroupRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"addons\": [],\n \"commitmentCycles\": 0,\n \"credits\": 0,\n \"customTax\": {\n \"enabled\": false,\n \"rate\": 0\n },\n \"dayPasses\": 0,\n \"description\": \"\",\n \"discounts\": {\n \"creditPackages\": 0,\n \"desks\": 0,\n \"equipment\": 0,\n \"events\": 0,\n \"rooms\": 0,\n \"shop\": 0\n },\n \"exclusiveAccess\": {\n \"resourceRefs\": []\n },\n \"grantedDiscounts\": [\n {\n \"coupon\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amountOff\": 123,\n \"currencyCode\": \"<string>\",\n \"percentOff\": 123,\n \"productTypes\": []\n }\n }\n ],\n \"printing\": {\n \"ezeepBlueGroupRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"selfSignup\": {\n \"enabled\": false,\n \"type\": \"immediate\"\n },\n \"setupFee\": 0\n }\n}"
response = http.request(request)
puts response.read_body{
"plan": {
"addons": [],
"commitmentCycles": 123,
"createDate": "2023-11-07T05:31:56Z",
"credits": 123,
"customTax": {
"enabled": true,
"rate": 123
},
"dayPasses": 123,
"description": "<string>",
"discounts": {
"creditPackages": 123,
"desks": 123,
"equipment": 123,
"events": 123,
"rooms": 123,
"shop": 123
},
"exclusiveAccess": {
"resourceRefs": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"grantedDiscounts": [
{
"coupon": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amountOff": 123,
"currencyCode": "<string>",
"enabledForCredits": true,
"limitedItems": {
"enabled": true,
"values": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>"
}
]
},
"limitedRedemption": {
"enabled": true,
"usage": 123,
"value": 123
},
"percentOff": 123,
"productTypes": []
}
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locale": "<string>",
"locationRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price": 123,
"selfSignup": {
"enabled": true
},
"setupFee": 123,
"title": "<string>",
"access": {
"avigilonAltaGroupRef": 123,
"brivoGroupRef": 123,
"kisiGroupRef": 123,
"saltoksAccessGroupRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tapkeyGroupRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"printing": {
"ezeepBlueGroupRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
}{
"message": "<string>",
"type": "<string>"
}Authorizations
BasicAuthOAuth2
See our authentication documentation for how to authorize your requests
Body
application/json
Plan to create.
Show child attributes
Show child attributes
Response
Created
Show child attributes
Show child attributes
Was this page helpful?
⌘I