Persist a geolocation
curl --request POST \
--url https://app.variable.global/api/v1/geolocation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"googleMapsId": "ChIJA4UGSG_xNIgRNBuiWqEV-Y0"
}
'import requests
url = "https://app.variable.global/api/v1/geolocation"
payload = { "googleMapsId": "ChIJA4UGSG_xNIgRNBuiWqEV-Y0" }
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({googleMapsId: 'ChIJA4UGSG_xNIgRNBuiWqEV-Y0'})
};
fetch('https://app.variable.global/api/v1/geolocation', 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://app.variable.global/api/v1/geolocation",
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([
'googleMapsId' => 'ChIJA4UGSG_xNIgRNBuiWqEV-Y0'
]),
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://app.variable.global/api/v1/geolocation"
payload := strings.NewReader("{\n \"googleMapsId\": \"ChIJA4UGSG_xNIgRNBuiWqEV-Y0\"\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://app.variable.global/api/v1/geolocation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"googleMapsId\": \"ChIJA4UGSG_xNIgRNBuiWqEV-Y0\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.variable.global/api/v1/geolocation")
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 \"googleMapsId\": \"ChIJA4UGSG_xNIgRNBuiWqEV-Y0\"\n}"
response = http.request(request)
puts response.read_body{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"googleMapsId": "ChIJA4UGSG_xNIgRNBuiWqEV-Y0",
"name": "Syracuse, NY, USA",
"countryCode": "US",
"latitude": 43.0481,
"longitude": -76.1474,
"locationType": "APPROXIMATE"
}{
"message": "token expired"
}Geolocation
Persist a Geolocation
Persist a chosen candidate (or a manual point) and get back its uuid.
POST
/
v1
/
geolocation
Persist a geolocation
curl --request POST \
--url https://app.variable.global/api/v1/geolocation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"googleMapsId": "ChIJA4UGSG_xNIgRNBuiWqEV-Y0"
}
'import requests
url = "https://app.variable.global/api/v1/geolocation"
payload = { "googleMapsId": "ChIJA4UGSG_xNIgRNBuiWqEV-Y0" }
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({googleMapsId: 'ChIJA4UGSG_xNIgRNBuiWqEV-Y0'})
};
fetch('https://app.variable.global/api/v1/geolocation', 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://app.variable.global/api/v1/geolocation",
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([
'googleMapsId' => 'ChIJA4UGSG_xNIgRNBuiWqEV-Y0'
]),
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://app.variable.global/api/v1/geolocation"
payload := strings.NewReader("{\n \"googleMapsId\": \"ChIJA4UGSG_xNIgRNBuiWqEV-Y0\"\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://app.variable.global/api/v1/geolocation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"googleMapsId\": \"ChIJA4UGSG_xNIgRNBuiWqEV-Y0\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.variable.global/api/v1/geolocation")
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 \"googleMapsId\": \"ChIJA4UGSG_xNIgRNBuiWqEV-Y0\"\n}"
response = http.request(request)
puts response.read_body{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"googleMapsId": "ChIJA4UGSG_xNIgRNBuiWqEV-Y0",
"name": "Syracuse, NY, USA",
"countryCode": "US",
"latitude": 43.0481,
"longitude": -76.1474,
"locationType": "APPROXIMATE"
}{
"message": "token expired"
}Requires permission:
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
- Option 1
- Option 2
Pattern:
^[A-Za-z0-9_-]{1,300}$Example:
"ChIJA4UGSG_xNIgRNBuiWqEV-Y0"
Response
The persisted geolocation
Present only on a persisted geolocation (the POST response); absent on search candidates.
Example:
"ChIJA4UGSG_xNIgRNBuiWqEV-Y0"
The geocoder's formatted address.
Example:
"Syracuse, NY, USA"
Example:
"US"
Example:
43.0481
Example:
-76.1474
Example:
"APPROXIMATE"
⌘I