Set the account name and whether the other side of a deal sees it
curl --request PATCH \
--url https://api.hashlock.markets/v1/me/profile \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"handle": "<3 to 24 characters: letters, digits, _>",
"handlePublic": true
}
'import requests
url = "https://api.hashlock.markets/v1/me/profile"
payload = {
"handle": "<3 to 24 characters: letters, digits, _>",
"handlePublic": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({handle: '<3 to 24 characters: letters, digits, _>', handlePublic: true})
};
fetch('https://api.hashlock.markets/v1/me/profile', 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.hashlock.markets/v1/me/profile",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'handle' => '<3 to 24 characters: letters, digits, _>',
'handlePublic' => true
]),
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://api.hashlock.markets/v1/me/profile"
payload := strings.NewReader("{\n \"handle\": \"<3 to 24 characters: letters, digits, _>\",\n \"handlePublic\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.hashlock.markets/v1/me/profile")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"handle\": \"<3 to 24 characters: letters, digits, _>\",\n \"handlePublic\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hashlock.markets/v1/me/profile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"handle\": \"<3 to 24 characters: letters, digits, _>\",\n \"handlePublic\": true\n}"
response = http.request(request)
puts response.read_body{
"handle": "<string>",
"handlePublic": true
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Account and keys
Set the account name and whether the other side of a deal sees it
The change the app makes in Account › Profile (“How you trade”), for an account that trades through its key alone. Send either field or both. An account is anonymous until handlePublic is true. From then on the accounts it negotiates with see its name and, beside the name, its record over all its swaps — those made while it was anonymous included (counterpartyName and counterpartyStats on a Thread); back to false hides both. A name may be set ten times an hour per account, counted together with changes made in the app; clearing it, re-sending the name the account already has and handlePublic are not counted. Needs a key with the taker or maker scope.
PATCH
/
v1
/
me
/
profile
Set the account name and whether the other side of a deal sees it
curl --request PATCH \
--url https://api.hashlock.markets/v1/me/profile \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"handle": "<3 to 24 characters: letters, digits, _>",
"handlePublic": true
}
'import requests
url = "https://api.hashlock.markets/v1/me/profile"
payload = {
"handle": "<3 to 24 characters: letters, digits, _>",
"handlePublic": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({handle: '<3 to 24 characters: letters, digits, _>', handlePublic: true})
};
fetch('https://api.hashlock.markets/v1/me/profile', 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.hashlock.markets/v1/me/profile",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'handle' => '<3 to 24 characters: letters, digits, _>',
'handlePublic' => true
]),
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://api.hashlock.markets/v1/me/profile"
payload := strings.NewReader("{\n \"handle\": \"<3 to 24 characters: letters, digits, _>\",\n \"handlePublic\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.hashlock.markets/v1/me/profile")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"handle\": \"<3 to 24 characters: letters, digits, _>\",\n \"handlePublic\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hashlock.markets/v1/me/profile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"handle\": \"<3 to 24 characters: letters, digits, _>\",\n \"handlePublic\": true\n}"
response = http.request(request)
puts response.read_body{
"handle": "<string>",
"handlePublic": true
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Body
application/json