curl --request POST \
--url https://api.ploti.ai/v1/subscriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Central Florida permits",
"places": [
"us-fl-12095",
"us-fl-12117"
],
"topics": [
"permits",
"code_enforcement"
],
"delivery": {
"type": "pull"
}
}
'import requests
url = "https://api.ploti.ai/v1/subscriptions"
payload = {
"name": "Central Florida permits",
"places": ["us-fl-12095", "us-fl-12117"],
"topics": ["permits", "code_enforcement"],
"delivery": { "type": "pull" }
}
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({
name: 'Central Florida permits',
places: ['us-fl-12095', 'us-fl-12117'],
topics: ['permits', 'code_enforcement'],
delivery: {type: 'pull'}
})
};
fetch('https://api.ploti.ai/v1/subscriptions', 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.ploti.ai/v1/subscriptions",
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([
'name' => 'Central Florida permits',
'places' => [
'us-fl-12095',
'us-fl-12117'
],
'topics' => [
'permits',
'code_enforcement'
],
'delivery' => [
'type' => 'pull'
]
]),
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://api.ploti.ai/v1/subscriptions"
payload := strings.NewReader("{\n \"name\": \"Central Florida permits\",\n \"places\": [\n \"us-fl-12095\",\n \"us-fl-12117\"\n ],\n \"topics\": [\n \"permits\",\n \"code_enforcement\"\n ],\n \"delivery\": {\n \"type\": \"pull\"\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://api.ploti.ai/v1/subscriptions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Central Florida permits\",\n \"places\": [\n \"us-fl-12095\",\n \"us-fl-12117\"\n ],\n \"topics\": [\n \"permits\",\n \"code_enforcement\"\n ],\n \"delivery\": {\n \"type\": \"pull\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ploti.ai/v1/subscriptions")
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 \"name\": \"Central Florida permits\",\n \"places\": [\n \"us-fl-12095\",\n \"us-fl-12117\"\n ],\n \"topics\": [\n \"permits\",\n \"code_enforcement\"\n ],\n \"delivery\": {\n \"type\": \"pull\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"places": [
"<string>"
],
"topics": [
"<string>"
],
"datasetIds": [
"<string>"
],
"delivery": {
"type": "pull"
},
"datasetCount": 123,
"createdAt": "2023-11-07T05:31:56Z",
"format": "geoparquet",
"lastEventId": "<string>"
}{
"error": {
"code": "not_found",
"message": "<string>",
"links": {}
}
}Create a subscription
Receive every dataset in the named places, optionally only some
topics, plus any datasets named directly. Datasets Ploti adds to
those places later join the subscription on their own, each with a
dataset.added event. Takes an Idempotency-Key header.
curl --request POST \
--url https://api.ploti.ai/v1/subscriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Central Florida permits",
"places": [
"us-fl-12095",
"us-fl-12117"
],
"topics": [
"permits",
"code_enforcement"
],
"delivery": {
"type": "pull"
}
}
'import requests
url = "https://api.ploti.ai/v1/subscriptions"
payload = {
"name": "Central Florida permits",
"places": ["us-fl-12095", "us-fl-12117"],
"topics": ["permits", "code_enforcement"],
"delivery": { "type": "pull" }
}
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({
name: 'Central Florida permits',
places: ['us-fl-12095', 'us-fl-12117'],
topics: ['permits', 'code_enforcement'],
delivery: {type: 'pull'}
})
};
fetch('https://api.ploti.ai/v1/subscriptions', 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.ploti.ai/v1/subscriptions",
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([
'name' => 'Central Florida permits',
'places' => [
'us-fl-12095',
'us-fl-12117'
],
'topics' => [
'permits',
'code_enforcement'
],
'delivery' => [
'type' => 'pull'
]
]),
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://api.ploti.ai/v1/subscriptions"
payload := strings.NewReader("{\n \"name\": \"Central Florida permits\",\n \"places\": [\n \"us-fl-12095\",\n \"us-fl-12117\"\n ],\n \"topics\": [\n \"permits\",\n \"code_enforcement\"\n ],\n \"delivery\": {\n \"type\": \"pull\"\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://api.ploti.ai/v1/subscriptions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Central Florida permits\",\n \"places\": [\n \"us-fl-12095\",\n \"us-fl-12117\"\n ],\n \"topics\": [\n \"permits\",\n \"code_enforcement\"\n ],\n \"delivery\": {\n \"type\": \"pull\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ploti.ai/v1/subscriptions")
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 \"name\": \"Central Florida permits\",\n \"places\": [\n \"us-fl-12095\",\n \"us-fl-12117\"\n ],\n \"topics\": [\n \"permits\",\n \"code_enforcement\"\n ],\n \"delivery\": {\n \"type\": \"pull\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"places": [
"<string>"
],
"topics": [
"<string>"
],
"datasetIds": [
"<string>"
],
"delivery": {
"type": "pull"
},
"datasetCount": 123,
"createdAt": "2023-11-07T05:31:56Z",
"format": "geoparquet",
"lastEventId": "<string>"
}{
"error": {
"code": "not_found",
"message": "<string>",
"links": {}
}
}Authorizations
An API key from Settings, API keys, with the feeds scope.
Headers
A retry with the same key returns the first answer instead of creating twice.
255Body
120Place ids. Every dataset in each place.
Only these topics within places. Every topic when left out.
Datasets to include on their own, in any covered place.
Where a subscription's files are delivered. More destination types are added as customers need them; each receives the same files.
- Pull
- Amazon S3
- Google Cloud Storage
Show child attributes
Show child attributes
The format pushed deliveries are written in.
geoparquet, csv Response
The subscription.
Where a subscription's files are delivered. More destination types are added as customers need them; each receives the same files.
- Pull
- Amazon S3
- Google Cloud Storage
Show child attributes
Show child attributes
geoparquet, csv