上传我的头像
curl --request PUT \
--url https://api.qbank.cl/platform/v1/me/avatar \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: image/jpeg' \
--data '"<string>"'import requests
url = "https://api.qbank.cl/platform/v1/me/avatar"
payload = "<string>"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "image/jpeg"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'image/jpeg'},
body: JSON.stringify('<string>')
};
fetch('https://api.qbank.cl/platform/v1/me/avatar', 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.qbank.cl/platform/v1/me/avatar",
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('<string>'),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: image/jpeg"
],
]);
$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.qbank.cl/platform/v1/me/avatar"
payload := strings.NewReader("\"<string>\"")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "image/jpeg")
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.qbank.cl/platform/v1/me/avatar")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "image/jpeg")
.body("\"<string>\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qbank.cl/platform/v1/me/avatar")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'image/jpeg'
request.body = "\"<string>\""
response = http.request(request)
puts response.read_body{
"status": "avatar_updated",
"content_type": "image/png",
"size_bytes": 20481,
"avatar_url": "https://cdn.cbpayapp.com/public/avatars/1fa63bd1-0000-4000-8000-000000000001/9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"
}上传我的头像
上传(或替换)账户头像。请求体为原始图片字节(JPEG、PNG 或 WebP),最大 512 KB。内容类型从文件魔数检测,绝不依赖请求头。当图片发布到公共 CDN 时,avatar_url 为无需认证即可加载的绝对 URL;否则为需认证的 API 路径。
PUT
/
v1
/
me
/
avatar
上传我的头像
curl --request PUT \
--url https://api.qbank.cl/platform/v1/me/avatar \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: image/jpeg' \
--data '"<string>"'import requests
url = "https://api.qbank.cl/platform/v1/me/avatar"
payload = "<string>"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "image/jpeg"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'image/jpeg'},
body: JSON.stringify('<string>')
};
fetch('https://api.qbank.cl/platform/v1/me/avatar', 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.qbank.cl/platform/v1/me/avatar",
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('<string>'),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: image/jpeg"
],
]);
$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.qbank.cl/platform/v1/me/avatar"
payload := strings.NewReader("\"<string>\"")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "image/jpeg")
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.qbank.cl/platform/v1/me/avatar")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "image/jpeg")
.body("\"<string>\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qbank.cl/platform/v1/me/avatar")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'image/jpeg'
request.body = "\"<string>\""
response = http.request(request)
puts response.read_body{
"status": "avatar_updated",
"content_type": "image/png",
"size_bytes": 20481,
"avatar_url": "https://cdn.cbpayapp.com/public/avatars/1fa63bd1-0000-4000-8000-000000000001/9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"
}授权
会话 JWT(来自注册/登录)或 API key(pk_...)。
也接受 X-API-Key: <token> 作为替代请求头。
请求体
image/jpegimage/pngimage/webp
The body is of type file.
响应
头像已更新。
最后修改于 2026年7月18日
⌘I