cURL
curl --request POST \
--url https://api.ctrl-hub.com/street-manager/permits \
--header 'Content-Type: text/plain' \
--data '
{
"Type": "<string>",
"MessageId": "<string>",
"Token": "<string>",
"TopicArn": "<string>",
"Message": "<string>",
"SubscribeURL": "<string>",
"Timestamp": "2023-11-07T05:31:56Z",
"SignatureVersion": "<string>",
"Signature": "<string>",
"SigningCertURL": "<string>"
}
'import requests
url = "https://api.ctrl-hub.com/street-manager/permits"
payload = {
"Type": "<string>",
"MessageId": "<string>",
"Token": "<string>",
"TopicArn": "<string>",
"Message": "<string>",
"SubscribeURL": "<string>",
"Timestamp": "2023-11-07T05:31:56Z",
"SignatureVersion": "<string>",
"Signature": "<string>",
"SigningCertURL": "<string>"
}
headers = {"Content-Type": "text/plain"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'text/plain'},
body: JSON.stringify({
Type: '<string>',
MessageId: '<string>',
Token: '<string>',
TopicArn: '<string>',
Message: '<string>',
SubscribeURL: '<string>',
Timestamp: '2023-11-07T05:31:56Z',
SignatureVersion: '<string>',
Signature: '<string>',
SigningCertURL: '<string>'
})
};
fetch('https://api.ctrl-hub.com/street-manager/permits', 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.ctrl-hub.com/street-manager/permits",
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([
'Type' => '<string>',
'MessageId' => '<string>',
'Token' => '<string>',
'TopicArn' => '<string>',
'Message' => '<string>',
'SubscribeURL' => '<string>',
'Timestamp' => '2023-11-07T05:31:56Z',
'SignatureVersion' => '<string>',
'Signature' => '<string>',
'SigningCertURL' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: text/plain"
],
]);
$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.ctrl-hub.com/street-manager/permits"
payload := strings.NewReader("{\n \"Type\": \"<string>\",\n \"MessageId\": \"<string>\",\n \"Token\": \"<string>\",\n \"TopicArn\": \"<string>\",\n \"Message\": \"<string>\",\n \"SubscribeURL\": \"<string>\",\n \"Timestamp\": \"2023-11-07T05:31:56Z\",\n \"SignatureVersion\": \"<string>\",\n \"Signature\": \"<string>\",\n \"SigningCertURL\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "text/plain")
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.ctrl-hub.com/street-manager/permits")
.header("Content-Type", "text/plain")
.body("{\n \"Type\": \"<string>\",\n \"MessageId\": \"<string>\",\n \"Token\": \"<string>\",\n \"TopicArn\": \"<string>\",\n \"Message\": \"<string>\",\n \"SubscribeURL\": \"<string>\",\n \"Timestamp\": \"2023-11-07T05:31:56Z\",\n \"SignatureVersion\": \"<string>\",\n \"Signature\": \"<string>\",\n \"SigningCertURL\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ctrl-hub.com/street-manager/permits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'text/plain'
request.body = "{\n \"Type\": \"<string>\",\n \"MessageId\": \"<string>\",\n \"Token\": \"<string>\",\n \"TopicArn\": \"<string>\",\n \"Message\": \"<string>\",\n \"SubscribeURL\": \"<string>\",\n \"Timestamp\": \"2023-11-07T05:31:56Z\",\n \"SignatureVersion\": \"<string>\",\n \"Signature\": \"<string>\",\n \"SigningCertURL\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "98ca4a78-b66f-4234-9719-aaf832ee6669",
"status": "400",
"title": "A validation error was encountered",
"source": {
"parameter": "include"
},
"meta": {
"resource": "wrong_value"
}
}{
"id": "05fc9c8d-73b9-4697-9337-57f7a567a48f",
"status": "401",
"title": "You are not authorised to access this resource",
"detail": "In order to access this resource, you need the 'admin' role.",
"code": "AUTH.001"
}{
"id": "fe9d9a69-f0a7-4fdc-bb2c-176027f316c5",
"status": "500",
"title": "Internal Server Error",
"detail": "An unexpected error occurred on the server."
}Street Manager
Create a new permit
This is used by street manager to create a new permit.
POST
/
street-manager
/
permits
cURL
curl --request POST \
--url https://api.ctrl-hub.com/street-manager/permits \
--header 'Content-Type: text/plain' \
--data '
{
"Type": "<string>",
"MessageId": "<string>",
"Token": "<string>",
"TopicArn": "<string>",
"Message": "<string>",
"SubscribeURL": "<string>",
"Timestamp": "2023-11-07T05:31:56Z",
"SignatureVersion": "<string>",
"Signature": "<string>",
"SigningCertURL": "<string>"
}
'import requests
url = "https://api.ctrl-hub.com/street-manager/permits"
payload = {
"Type": "<string>",
"MessageId": "<string>",
"Token": "<string>",
"TopicArn": "<string>",
"Message": "<string>",
"SubscribeURL": "<string>",
"Timestamp": "2023-11-07T05:31:56Z",
"SignatureVersion": "<string>",
"Signature": "<string>",
"SigningCertURL": "<string>"
}
headers = {"Content-Type": "text/plain"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'text/plain'},
body: JSON.stringify({
Type: '<string>',
MessageId: '<string>',
Token: '<string>',
TopicArn: '<string>',
Message: '<string>',
SubscribeURL: '<string>',
Timestamp: '2023-11-07T05:31:56Z',
SignatureVersion: '<string>',
Signature: '<string>',
SigningCertURL: '<string>'
})
};
fetch('https://api.ctrl-hub.com/street-manager/permits', 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.ctrl-hub.com/street-manager/permits",
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([
'Type' => '<string>',
'MessageId' => '<string>',
'Token' => '<string>',
'TopicArn' => '<string>',
'Message' => '<string>',
'SubscribeURL' => '<string>',
'Timestamp' => '2023-11-07T05:31:56Z',
'SignatureVersion' => '<string>',
'Signature' => '<string>',
'SigningCertURL' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: text/plain"
],
]);
$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.ctrl-hub.com/street-manager/permits"
payload := strings.NewReader("{\n \"Type\": \"<string>\",\n \"MessageId\": \"<string>\",\n \"Token\": \"<string>\",\n \"TopicArn\": \"<string>\",\n \"Message\": \"<string>\",\n \"SubscribeURL\": \"<string>\",\n \"Timestamp\": \"2023-11-07T05:31:56Z\",\n \"SignatureVersion\": \"<string>\",\n \"Signature\": \"<string>\",\n \"SigningCertURL\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "text/plain")
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.ctrl-hub.com/street-manager/permits")
.header("Content-Type", "text/plain")
.body("{\n \"Type\": \"<string>\",\n \"MessageId\": \"<string>\",\n \"Token\": \"<string>\",\n \"TopicArn\": \"<string>\",\n \"Message\": \"<string>\",\n \"SubscribeURL\": \"<string>\",\n \"Timestamp\": \"2023-11-07T05:31:56Z\",\n \"SignatureVersion\": \"<string>\",\n \"Signature\": \"<string>\",\n \"SigningCertURL\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ctrl-hub.com/street-manager/permits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'text/plain'
request.body = "{\n \"Type\": \"<string>\",\n \"MessageId\": \"<string>\",\n \"Token\": \"<string>\",\n \"TopicArn\": \"<string>\",\n \"Message\": \"<string>\",\n \"SubscribeURL\": \"<string>\",\n \"Timestamp\": \"2023-11-07T05:31:56Z\",\n \"SignatureVersion\": \"<string>\",\n \"Signature\": \"<string>\",\n \"SigningCertURL\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "98ca4a78-b66f-4234-9719-aaf832ee6669",
"status": "400",
"title": "A validation error was encountered",
"source": {
"parameter": "include"
},
"meta": {
"resource": "wrong_value"
}
}{
"id": "05fc9c8d-73b9-4697-9337-57f7a567a48f",
"status": "401",
"title": "You are not authorised to access this resource",
"detail": "In order to access this resource, you need the 'admin' role.",
"code": "AUTH.001"
}{
"id": "fe9d9a69-f0a7-4fdc-bb2c-176027f316c5",
"status": "500",
"title": "Internal Server Error",
"detail": "An unexpected error occurred on the server."
}Body
text/plain
The permit to handle.
- Option 1
- Option 2
Street Manager subscription confirmation payload
The message type
Unique identifier for the message
Confirmation token
The ARN of the topic
The confirmation message
URL to confirm the subscription
When the message was sent
Version of the signature
Message signature for verification
URL of the signing certificate
Response
Permit request processed successfully
⌘I