/v1/consumer/me/username
curl --request PUT \
--url https://api.truthlocks.com/v1/consumer/me/username \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"username": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({username: '<string>'})
};
fetch('https://api.truthlocks.com/v1/consumer/me/username', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/consumer/me/username"
payload = { "username": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/consumer/me/username"
payload := strings.NewReader("{\n \"username\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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))
}Consommateur (B2C)
Réclamer un nom d'utilisateur de portefeuille
PUT
/
v1
/
consumer
/
me
/
username
/v1/consumer/me/username
curl --request PUT \
--url https://api.truthlocks.com/v1/consumer/me/username \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"username": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({username: '<string>'})
};
fetch('https://api.truthlocks.com/v1/consumer/me/username', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/consumer/me/username"
payload = { "username": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/consumer/me/username"
payload := strings.NewReader("{\n \"username\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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))
}Revendique un nom d’utilisateur unique pour le consommateur connecté. Utilisez un nom d’utilisateur valide en minuscules et gérez un conflit s’il est déjà attribué. La revendication d’un nom d’utilisateur ne publie pas automatiquement les protections privées ; la visibilité du portefeuille est contrôlée séparément.

