cURL
curl --request POST \
--url https://api.ctrl-hub.com/street-manager/activities \
--header 'Content-Type: text/plain' \
--data '{
"Type": "<string>"
}'import requests
url = "https://api.ctrl-hub.com/street-manager/activities"
payload = "{\n \"Type\": \"<string>\"\n}"
headers = {"Content-Type": "text/plain"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'text/plain'},
body: '{\n "Type": "<string>"\n}'
};
fetch('https://api.ctrl-hub.com/street-manager/activities', 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/activities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\n \"Type\": \"<string>\"\n}",
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/activities"
payload := strings.NewReader("{\n \"Type\": \"<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/activities")
.header("Content-Type", "text/plain")
.body("{\n \"Type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ctrl-hub.com/street-manager/activities")
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}"
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 activity
This is used by street manager to create a new activity.
POST
/
street-manager
/
activities
cURL
curl --request POST \
--url https://api.ctrl-hub.com/street-manager/activities \
--header 'Content-Type: text/plain' \
--data '{
"Type": "<string>"
}'import requests
url = "https://api.ctrl-hub.com/street-manager/activities"
payload = "{\n \"Type\": \"<string>\"\n}"
headers = {"Content-Type": "text/plain"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'text/plain'},
body: '{\n "Type": "<string>"\n}'
};
fetch('https://api.ctrl-hub.com/street-manager/activities', 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/activities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\n \"Type\": \"<string>\"\n}",
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/activities"
payload := strings.NewReader("{\n \"Type\": \"<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/activities")
.header("Content-Type", "text/plain")
.body("{\n \"Type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ctrl-hub.com/street-manager/activities")
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}"
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 activity to handle.
A message AWS SNS posts for a Street Manager topic, as a JSON document sent as text/plain. Its
Type is SubscriptionConfirmation or Notification, and the receiver decodes it. See
https://docs.aws.amazon.com/sns/latest/dg/http-notification-json.html for its members.
The message type, SubscriptionConfirmation or Notification.
Response
Activity request processed successfully