curl --request PUT \
--url https://api.spirii.com/v2/app-users/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phoneNumber": "<string>",
"whitelabel": "<string>"
}
'import requests
url = "https://api.spirii.com/v2/app-users/{id}"
payload = {
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phoneNumber": "<string>",
"whitelabel": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
firstName: '<string>',
lastName: '<string>',
email: '<string>',
phoneNumber: '<string>',
whitelabel: '<string>'
})
};
fetch('https://api.spirii.com/v2/app-users/{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/v2/app-users/{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([
'firstName' => '<string>',
'lastName' => '<string>',
'email' => '<string>',
'phoneNumber' => '<string>',
'whitelabel' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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/v2/app-users/{id}"
payload := strings.NewReader("{\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"whitelabel\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
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/v2/app-users/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"whitelabel\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spirii.com/v2/app-users/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"whitelabel\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"createdAt": "2023-11-07T05:31:56Z",
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phoneNumber": "<string>",
"whitelabel": "<string>",
"newsletter": true,
"whitelabelCompany": {
"id": 123,
"name": "<string>"
},
"company": {
"id": 123,
"crmId": 123,
"name": "<string>"
},
"operatorId": 123,
"companyId": 123,
"firebaseUserId": "<string>",
"stripeId": "<string>",
"locations": [
{
"locationId": 123,
"name": "<string>",
"streetAddress": "<string>",
"zipCode": "<string>",
"city": "<string>",
"countryId": 123
}
],
"chargeCards": [
{
"id": 123,
"label": "<string>",
"uid": "<string>",
"crmCustomerId": 123,
"active": true,
"roamingEnabled": true,
"comment": "<string>",
"type": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
],
"creditCards": [
{
"cardId": "<string>",
"brand": "<string>",
"lastFour": "<string>",
"expMonth": 123,
"expYear": 123,
"isDefault": true,
"lastUsedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"setupIntentId": "<string>"
}
],
"vouchers": [
{
"voucherId": 123,
"createdAt": "2023-11-07T05:31:56Z",
"groupId": 123,
"code": "<string>",
"maxUsers": 123,
"expiresAt": "2023-11-07T05:31:56Z",
"notes": "<string>",
"perKwh": 123,
"locations": {}
}
]
}Update app user
Updates an app user. Only available to operators with a whitelabel app.
curl --request PUT \
--url https://api.spirii.com/v2/app-users/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phoneNumber": "<string>",
"whitelabel": "<string>"
}
'import requests
url = "https://api.spirii.com/v2/app-users/{id}"
payload = {
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phoneNumber": "<string>",
"whitelabel": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
firstName: '<string>',
lastName: '<string>',
email: '<string>',
phoneNumber: '<string>',
whitelabel: '<string>'
})
};
fetch('https://api.spirii.com/v2/app-users/{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/v2/app-users/{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([
'firstName' => '<string>',
'lastName' => '<string>',
'email' => '<string>',
'phoneNumber' => '<string>',
'whitelabel' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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/v2/app-users/{id}"
payload := strings.NewReader("{\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"whitelabel\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
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/v2/app-users/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"whitelabel\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spirii.com/v2/app-users/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"whitelabel\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"createdAt": "2023-11-07T05:31:56Z",
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phoneNumber": "<string>",
"whitelabel": "<string>",
"newsletter": true,
"whitelabelCompany": {
"id": 123,
"name": "<string>"
},
"company": {
"id": 123,
"crmId": 123,
"name": "<string>"
},
"operatorId": 123,
"companyId": 123,
"firebaseUserId": "<string>",
"stripeId": "<string>",
"locations": [
{
"locationId": 123,
"name": "<string>",
"streetAddress": "<string>",
"zipCode": "<string>",
"city": "<string>",
"countryId": 123
}
],
"chargeCards": [
{
"id": 123,
"label": "<string>",
"uid": "<string>",
"crmCustomerId": 123,
"active": true,
"roamingEnabled": true,
"comment": "<string>",
"type": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
],
"creditCards": [
{
"cardId": "<string>",
"brand": "<string>",
"lastFour": "<string>",
"expMonth": 123,
"expYear": 123,
"isDefault": true,
"lastUsedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"setupIntentId": "<string>"
}
],
"vouchers": [
{
"voucherId": 123,
"createdAt": "2023-11-07T05:31:56Z",
"groupId": 123,
"code": "<string>",
"maxUsers": 123,
"expiresAt": "2023-11-07T05:31:56Z",
"notes": "<string>",
"perKwh": 123,
"locations": {}
}
]
}Authorizations
Authorization: Bearer <SPIRII_API_KEY>
Path Parameters
App user id
Body
Response
The unique identifier of the app user.
The creation date of the app user.
The first name of the app user.
The last name of the app user.
The email address of the app user.
The phone number of the app user.
The whitelabel the app user belongs to.
Indicates whether the app user is subscribed to the newsletter.
The whitelabel company associated with the app user.
Show child attributes
Show child attributes
The company associated with the app user.
Show child attributes
Show child attributes
The unique identifier of the operator the app user belongs to.
The unique identifier of the company the app user belongs to.
The Firebase user identifier associated with the app user.
The Stripe customer identifier associated with the app user.
The locations associated with the app user.
Show child attributes
Show child attributes
The charge cards associated with the app user.
Show child attributes
Show child attributes
The credit cards associated with the app user.
Show child attributes
Show child attributes
The vouchers associated with the app user.
Show child attributes
Show child attributes
Was this page helpful?