Send Chat Message
HTTP Request
POST /v5/p2p/order/message/send
Request Parameters
Parameter | Required | Type | Comments |
---|---|---|---|
message | true | string | Chat message. Is either: the text of the message you send, or the URL of the file you want to send |
contentType | true | string | Chat message.
|
orderId | true | string | Order ID |
msgUuid | true | string | Client message UUID |
fileName | false | string | Image/pdf/video filename |
Response Parameters
None
Request Example
- HTTP
- Python
POST /v5/p2p/item/online HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
X-BAPI-TIMESTAMP: 1675866354698
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json
{
"message":"hi, test",
"contentType":"str",
"orderId":"1898976123321221120"
}
from bybit_p2p import P2P
import uuid
api = P2P(
testnet=True,
api_key="xxxxxxxxxxxxxxxxxx",
api_secret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
)
print(api.send_chat_message(
message="hi, test",
contentType="str",
orderId="1898976123321221120",
msgUuid=uuid.uuid4().hex
))
Response Example
{
"ret_code": 0,
"ret_msg": "SUCCESS",
"result": null,
"ext_code": "",
"ext_info": {},
"time_now": "1741763625.212991"
}