Location
User location and history
curl -X GET "https://example.com/location/e2ee/config"fetch("https://example.com/location/e2ee/config")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/location/e2ee/config"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/location/e2ee/config"
response = requests.request("GET", url)
print(response.text)Empty
Set location sharing configuration for a friend
Request Body
application/jsonRequiredfriendHandleRequiredstringenabledbooleanrefreshIntervalnumberexpiresAtstringResponse Body
curl -X POST "https://example.com/location/e2ee/config" \
-H "Content-Type: application/json" \
-d '{
"friendHandle": "string",
"enabled": true,
"refreshInterval": 0,
"expiresAt": "string"
}'const body = JSON.stringify({
"friendHandle": "string",
"enabled": true,
"refreshInterval": 0,
"expiresAt": "string"
})
fetch("https://example.com/location/e2ee/config", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://example.com/location/e2ee/config"
body := strings.NewReader(`{
"friendHandle": "string",
"enabled": true,
"refreshInterval": 0,
"expiresAt": "string"
}`)
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/location/e2ee/config"
body = {
"friendHandle": "string",
"enabled": true,
"refreshInterval": 0,
"expiresAt": "string"
}
response = requests.request("POST", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text)Empty
curl -X DELETE "https://example.com/location/e2ee/config/string"fetch("https://example.com/location/e2ee/config/string")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/location/e2ee/config/string"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/location/e2ee/config/string"
response = requests.request("DELETE", url)
print(response.text)Empty
Update location: broadcast to friends and store in history
Request Body
application/jsonRequiredlocationsRequiredarray<object>historyobjectResponse Body
curl -X POST "https://example.com/location/e2ee/update" \
-H "Content-Type: application/json" \
-d '{
"locations": [
{
"forFriendHandle": "string",
"encryptedLocation": "string",
"nonce": "string"
}
],
"history": {
"encryptedLocation": "string",
"nonce": "string",
"timestamp": "string"
}
}'const body = JSON.stringify({
"locations": [
{
"forFriendHandle": "string",
"encryptedLocation": "string",
"nonce": "string"
}
],
"history": {
"encryptedLocation": "string",
"nonce": "string",
"timestamp": "string"
}
})
fetch("https://example.com/location/e2ee/update", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://example.com/location/e2ee/update"
body := strings.NewReader(`{
"locations": [
{
"forFriendHandle": "string",
"encryptedLocation": "string",
"nonce": "string"
}
],
"history": {
"encryptedLocation": "string",
"nonce": "string",
"timestamp": "string"
}
}`)
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/location/e2ee/update"
body = {
"locations": [
{
"forFriendHandle": "string",
"encryptedLocation": "string",
"nonce": "string"
}
],
"history": {
"encryptedLocation": "string",
"nonce": "string",
"timestamp": "string"
}
}
response = requests.request("POST", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text)Empty
curl -X GET "https://example.com/location/e2ee/friends"fetch("https://example.com/location/e2ee/friends")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/location/e2ee/friends"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/location/e2ee/friends"
response = requests.request("GET", url)
print(response.text)Empty
curl -X GET "https://example.com/location/e2ee/history?limit=0"fetch("https://example.com/location/e2ee/history?limit=0")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/location/e2ee/history?limit=0"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/location/e2ee/history?limit=0"
response = requests.request("GET", url)
print(response.text)Empty