Update location data
curl --request PUT \
--url https://api.spirii.com/locations/{id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "Gentofte Hospital",
"isPublic": true,
"lat": 55.41392687,
"lon": 11.34266069
}
'import requests
url = "https://api.spirii.com/locations/{id}"
payload = {
"name": "Gentofte Hospital",
"isPublic": True,
"lat": 55.41392687,
"lon": 11.34266069
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Gentofte Hospital', isPublic: true, lat: 55.41392687, lon: 11.34266069})
};
fetch('https://api.spirii.com/locations/{id}', 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.spirii.com/locations/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Gentofte Hospital',
'isPublic' => true,
'lat' => 55.41392687,
'lon' => 11.34266069
]),
CURLOPT_HTTPHEADER => [
"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.spirii.com/locations/{id}"
payload := strings.NewReader("{\n \"name\": \"Gentofte Hospital\",\n \"isPublic\": true,\n \"lat\": 55.41392687,\n \"lon\": 11.34266069\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://api.spirii.com/locations/{id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Gentofte Hospital\",\n \"isPublic\": true,\n \"lat\": 55.41392687,\n \"lon\": 11.34266069\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spirii.com/locations/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Gentofte Hospital\",\n \"isPublic\": true,\n \"lat\": 55.41392687,\n \"lon\": 11.34266069\n}"
response = http.request(request)
puts response.read_body{
"id": 1158,
"name": "ERWII",
"streetAddress": "Kokbjerg 30",
"zipCode": "6000",
"city": "Kolding",
"country": "Denmark",
"operatorId": 1,
"companyId": 7,
"type": "Parking lot",
"isPublic": true,
"coordinate": {
"lat": 55.53578,
"lon": 9.486323
},
"fuseCapacity": 32,
"chargeBoxes": [
{
"id": 1,
"cpSerialNumber": "CPSN1",
"CBID": "DK.SPI.Z1",
"firstUsageAt": "2021-01-29 06:45:22",
"evses": [
"DK.SPI.Z1*1",
"DK.SPI.Z1*2"
]
},
{
"id": 2,
"cpSerialNumber": "CPSN2",
"CBID": "DK.SPI.Z2",
"firstUsageAt": "2021-01-29 06:45:22",
"evses": [
"DK.SPI.Z2*1",
"DK.SPI.Z2*2"
]
}
],
"appUsers": [],
"orders": [],
"pricing": {
"perKwh": 3,
"currency": "DKK",
"vat": 0.25
}
}{
"error": {
"message": "Querystring parameter `id` is not allowed",
"statusCode": 400,
"code": "QueryParamNotAllowed"
}
}{
"error": {
"message": "Something went wroing, try again later",
"statusCode": 500
}
}Update location data
PUT
/
locations
/
{id}
Update location data
curl --request PUT \
--url https://api.spirii.com/locations/{id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "Gentofte Hospital",
"isPublic": true,
"lat": 55.41392687,
"lon": 11.34266069
}
'import requests
url = "https://api.spirii.com/locations/{id}"
payload = {
"name": "Gentofte Hospital",
"isPublic": True,
"lat": 55.41392687,
"lon": 11.34266069
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Gentofte Hospital', isPublic: true, lat: 55.41392687, lon: 11.34266069})
};
fetch('https://api.spirii.com/locations/{id}', 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.spirii.com/locations/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Gentofte Hospital',
'isPublic' => true,
'lat' => 55.41392687,
'lon' => 11.34266069
]),
CURLOPT_HTTPHEADER => [
"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.spirii.com/locations/{id}"
payload := strings.NewReader("{\n \"name\": \"Gentofte Hospital\",\n \"isPublic\": true,\n \"lat\": 55.41392687,\n \"lon\": 11.34266069\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://api.spirii.com/locations/{id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Gentofte Hospital\",\n \"isPublic\": true,\n \"lat\": 55.41392687,\n \"lon\": 11.34266069\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spirii.com/locations/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Gentofte Hospital\",\n \"isPublic\": true,\n \"lat\": 55.41392687,\n \"lon\": 11.34266069\n}"
response = http.request(request)
puts response.read_body{
"id": 1158,
"name": "ERWII",
"streetAddress": "Kokbjerg 30",
"zipCode": "6000",
"city": "Kolding",
"country": "Denmark",
"operatorId": 1,
"companyId": 7,
"type": "Parking lot",
"isPublic": true,
"coordinate": {
"lat": 55.53578,
"lon": 9.486323
},
"fuseCapacity": 32,
"chargeBoxes": [
{
"id": 1,
"cpSerialNumber": "CPSN1",
"CBID": "DK.SPI.Z1",
"firstUsageAt": "2021-01-29 06:45:22",
"evses": [
"DK.SPI.Z1*1",
"DK.SPI.Z1*2"
]
},
{
"id": 2,
"cpSerialNumber": "CPSN2",
"CBID": "DK.SPI.Z2",
"firstUsageAt": "2021-01-29 06:45:22",
"evses": [
"DK.SPI.Z2*1",
"DK.SPI.Z2*2"
]
}
],
"appUsers": [],
"orders": [],
"pricing": {
"perKwh": 3,
"currency": "DKK",
"vat": 0.25
}
}{
"error": {
"message": "Querystring parameter `id` is not allowed",
"statusCode": 400,
"code": "QueryParamNotAllowed"
}
}{
"error": {
"message": "Something went wroing, try again later",
"statusCode": 500
}
}Path Parameters
location ID to retrieve
Example:
1
Body
application/json
Location data
Response
Location data of specific location
id
Example:
1
name
Example:
"Kokbjerg"
street
Example:
"Kokbjerg 30"
zip code
Example:
"6000"
city
Example:
"Kolding"
country
Example:
"Denmark"
operator id
Example:
1
company id
Example:
1
location type
Example:
"Parking lot"
Public status identifier
Example:
true
Show child attributes
Show child attributes
fuse capacity
Example:
32
ChargeBoxes
Show child attributes
Show child attributes
users id
orders id
Example:
1
Show child attributes
Show child attributes
Was this page helpful?