I am send QR image in chat through API,
using c2c messaging docs, i was properly able to send messages and receive and websocket everything working fine,
spot api most endpoints are working fine, but for sending Image in chat, We have to obtain a presigned URL for that
I am unable to get that,
this is my relevent JAVA code
private final String IMAGE_PRESIGNED_URL = "/sapi/v1/c2c/chat/image/pre-signed-url";
and
in order to get the presigned URL
public String retrieveImagePreSignedUrl() {
String fileName = UUID.randomUUID().toString();
Map<String, Object> bodyParameters = new HashMap<>();
bodyParameters.put("imageName", fileName);
return requestHandler.sendSignedRequest(baseUrl, IMAGE_PRESIGNED_URL, null, HttpMethod.POST, showLimitUsage,bodyParameters);
}
this is giving me below exception
{"code":2,"msg":"参数异常"}
- this is the first time i am receiving error in chinese
- the response code received is 500 (usually comes in 4XX range)
- the sendSignedRequest method is working fine coz even below code to get Ad detail is working fine
public String getAdDetailsByMerchantNo( String merchantNo, Map<String, String> headers) {
Map<String, Object> parameters = new HashMap<>();
if (merchantNo != null && !merchantNo.isEmpty()) {
parameters.put("merchantNo", merchantNo);
}
return requestHandler.sendSignedRequest(baseUrl, GET_AD_DETAILS_BY_MERCHANT_NO, parameters, HttpMethod.GET, showLimitUsage);
}
below is the actual response i am getting
Request :
=== BINANCE API REQUEST ===
URL: https://api.binance.com/sapi/v1/c2c/chat/image/pre-signed-url?signature=52bf4ba70dde8dbbaf65c7709b20725d90d1741081465782cec6150e608c290a×tamp=1749479641275
Method: POST
Headers: User-Agent: binance-connector-java/3.4.1
Content-Type: application/x-www-form-urlencoded
X-MBX-APIKEY:
Body: {“imageName”:“1f17db38-82ee-46e3-a81f-d949ebab488b”}
===========================
Response :
=== BINANCE API RESPONSE ===
Status Code: 500
Status Message:
Headers: content-type: application/json
content-length: 31
date: Mon, 09 Jun 2025 14:34:03 GMT
expires: 0
server: nginx
x-sapi-used-uid-weight-1m: 5000
strict-transport-security: max-age=31536000; includeSubdomains
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
content-security-policy: default-src ‘self’
x-content-security-policy: default-src ‘self’
x-webkit-csp: default-src ‘self’
cache-control: no-cache, no-store, must-revalidate
pragma: no-cache
x-cache: Error from cloudfront
via: 1.1 857ce214a257a73bd9afdb1c9b13c094.cloudfront.net (CloudFront)
x-amz-cf-pop: DEL51-P6
x-amz-cf-id: f_zPLXHp39tkc82hnKRiz0zdCjEFs7L08L0vr_PXa4NcbL3hpg-DzA==
Body: {“code”:2,“msg”:“参数异常”}
============================