SAPI API for P2P not working


I’m working with the SAPI API for P2P but it seems all the post requests are not working for me

Example of the code is shown below

import hmac
import time
import hashlib
import requests
from urllib.parse import urlencode


def hashing(query_string):
        SECRET.encode("utf-8"), query_string.encode("utf-8"), hashlib.sha256

def get_timestamp():
    return int(time.time() * 1000)

def dispatch_request(http_method):
    session = requests.Session()
        {"Content-Type": "application/json;charset=utf-8", "X-MBX-APIKEY": KEY}
    return {
        "GET": session.get,
        "DELETE": session.delete,
        "PUT": session.put,
    }.get(http_method, "GET")

# used for sending request requires the signature
def send_signed_request(http_method, url_path, payload={}):
    query_string = urlencode(payload, True)
    if query_string:
        query_string = "{}&timestamp={}".format(query_string, get_timestamp())
        query_string = "timestamp={}".format(get_timestamp())

    url = (
        BASE_URL + url_path + "?" + query_string + "&signature=" + hashing(query_string)
    print("{} {}".format(http_method, url))
    params = {"url": url, "params": {}}
    response = dispatch_request(http_method)(**params)
    return response.json()

# used for sending public data request
def send_public_request(url_path, payload={}):
    query_string = urlencode(payload, True)
    url = BASE_URL + url_path
    if query_string:
        url = url + "?" + query_string
    response = dispatch_request("GET")(url=url)
    return response.json()

params = {
        "adsNo": "11405603645832523776"}

response = send_signed_request("POST", "/sapi/v1/c2c/ads/getDetailByNo", params)

It's returning this error
{'code': 500000001, 'msg': 'You have entered incomplete information. Please update the data.'}

The code produces this URL 
Which is similar to the URL in the docs, no data is missing as the error is suggesting

What can i do to solve this error?

Hello, I didn’t find /sapi/v1/c2c/ads/getDetailByNo publicly and we can only cover endpoints on public API documentation. How to did you get this endpoint? It might be a good idea to reach out to your account manager for further help.

I have the same issue. What do you mean account manager, there’s no such thing. After reaching out to customer support, they ignore you for a week and then give silly responses like “try putting parameters like this parameter=value in the query string”. If you have dedicated apis for p2p merchants, why only half of them works, and when we try to reach out to you about these problems, you just ignore?

@Yevhen_Hukalo Can you share the source of where you obtained the endpoint?
In this forum, we usually only cover for the endpoints available at