Coinlocally Docs
API Document
API Document
  • Introduction
    • API Basic Information
    • HTTP Error Codes
    • General Information
    • Limits
    • Endpoint Security Type
    • Signature Authentication
    • Timing Security
    • SIGNED Endpoint Example
  • Changelog
  • Spot
    • Public
    • Market
    • Trade
    • Account
  • Futures
    • Public
    • Market
    • Trade
    • Account
  • Margin
  • Withdraw
  • WebSocket
    • Spot
    • Futures
  • Official SDK
  • Enums
  • Error
  • FAQ
Powered by GitBook
On this page
  • ๐Ÿ” Keys
  • ๐Ÿ“ฆ Request Parameters
  • ๐Ÿงพ Request Body
  • ๐Ÿ” Signature Construction
  • Example values:
  • Signature Command (Linux):
  • Output:
  • ๐Ÿ“ก cURL Command
  1. Introduction

SIGNED Endpoint Example

This step-by-step guide demonstrates how to send a valid signed payload from the Linux command line using echo, openssl, and curl.


๐Ÿ” Keys

Key
Value

apiKey

vmPUZE6mv9SD5V5e14y7Ju91duEh8A

secretKey

902ae3cb34ecee2779aa4d3e1d226686


๐Ÿ“ฆ Request Parameters

Parameter
Value

symbol

BTCUSDT

side

BUY

type

LIMIT

volume

1

price

9300


๐Ÿงพ Request Body

jsonCopyEdit{"symbol":"BTCUSDT","price":"9300","volume":"1","side":"BUY","type":"LIMIT"}

๐Ÿ” Signature Construction

Using:

sqlCopyEdittimestamp + method + requestPath + body

Example values:

  • timestamp: 1588591856950

  • method: POST

  • requestPath: /sapi/v1/order/test

  • body: {"symbol":"BTCUSDT","price":"9300","volume":"1","side":"BUY","type":"LIMIT"}

Signature Command (Linux):

bashCopyEditecho -n "1588591856950POST/sapi/v1/order/test{\"symbol\":\"BTCUSDT\",\"price\":\"9300\",\"volume\":\"1\",\"side\":\"BUY\",\"type\":\"LIMIT\"}" \
| openssl dgst -sha256 -hmac "902ae3cb34ecee2779aa4d3e1d226686"

Output:

luaCopyEdit(stdin)= c50d0a74bb9427a9a03933d0eded03af9bf50115dc5b706882a4fcf07a26b761

๐Ÿ“ก cURL Command

bashCopyEditcurl -X POST https://openapi.coinlocally.com/sapi/v1/order/test \
  -H "Content-Type: application/json" \
  -H "X-CH-APIKEY: vmPUZE6mv9SD5V5e14y7Ju91duEh8A" \
  -H "X-CH-SIGN: c50d0a74bb9427a9a03933d0eded03af9bf50115dc5b706882a4fcf07a26b761" \
  -H "X-CH-TS: 1588591856950" \
  -d '{"symbol":"BTCUSDT","price":"9300","volume":"1","side":"BUY","type":"LIMIT"}'
PreviousTiming SecurityNextChangelog

Last updated 18 days ago