├── .gitignore ├── ConfigEnv.png ├── ImportCollection.png ├── ImportEnvironment.png ├── BybitTestnet.postman_environment.json ├── README.md └── V5APIs └── Tax V3.postman_collection.json /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /ConfigEnv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bybit-exchange/QuickStartWithPostman/HEAD/ConfigEnv.png -------------------------------------------------------------------------------- /ImportCollection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bybit-exchange/QuickStartWithPostman/HEAD/ImportCollection.png -------------------------------------------------------------------------------- /ImportEnvironment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bybit-exchange/QuickStartWithPostman/HEAD/ImportEnvironment.png -------------------------------------------------------------------------------- /BybitTestnet.postman_environment.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "f212859b-a7df-464a-860a-955fa766e69e", 3 | "name": "BybitTestnet", 4 | "values": [ 5 | { 6 | "key": "url", 7 | "value": "https://api-testnet.bybit.com", 8 | "enabled": true 9 | }, 10 | { 11 | "key": "bybit-api-key", 12 | "value": "y6aCh5sAiI97z3Mxp3", 13 | "enabled": true 14 | }, 15 | { 16 | "key": "bybit-api-secret", 17 | "value": "i2iWTdiDGXPFfSrMvWkXoQ4JYBh62DqC2aCu", 18 | "enabled": true 19 | }, 20 | { 21 | "key": "signature", 22 | "value": "", 23 | "enabled": true 24 | }, 25 | { 26 | "key": "timestamp", 27 | "value": "", 28 | "enabled": true 29 | }, 30 | { 31 | "key": "U_Futures_orderId", 32 | "value": "", 33 | "enabled": true 34 | } 35 | ], 36 | "_postman_variable_scope": "environment", 37 | "_postman_exported_at": "2021-06-08T04:12:01.607Z", 38 | "_postman_exported_using": "Postman/8.5.1" 39 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # QuickStartWithPostman 2 | 3 | [Postman] is an API collaboration platform. Please access https://www.postman.com/ to download and install the client locally. (There's also a web version so please visit their website to find out more details.) 4 | 5 | ## How to import collections 6 | 7 | - Download the collections (`git clone` is recommended) from https://github.com/bybit-exchange/QuickStartWithPostman. 8 | - Import the collections into the Postman app. 9 | 10 |

11 | 12 | 13 | 14 | ## How to import the environment 15 | - Download the environment JSON file. (We have provided a testnet environment for your reference.) 16 | - Refer to the below screenshot to import your environment. 17 | 18 |

19 | 20 | - Update the API key and secret accordingly. If you want to test in mainnet, update the URL to `https://api.bybit.com`. 21 | 22 |

23 | -------------------------------------------------------------------------------- /V5APIs/Tax V3.postman_collection.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "_postman_id": "c9734096-8839-45b5-a5a9-6ddc30dea2a4", 4 | "name": "Tax V3", 5 | "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", 6 | "_exporter_id": "25704187" 7 | }, 8 | "item": [ 9 | { 10 | "name": "Get User Register Date", 11 | "request": { 12 | "method": "POST", 13 | "header": [ 14 | { 15 | "key": "X-BAPI-SIGN", 16 | "value": "{{signature}}", 17 | "type": "text" 18 | }, 19 | { 20 | "key": "X-BAPI-API-KEY", 21 | "value": "{{bybit-api-key}}", 22 | "type": "text" 23 | }, 24 | { 25 | "key": "X-BAPI-TIMESTAMP", 26 | "value": "{{timestamp}}", 27 | "type": "text" 28 | }, 29 | { 30 | "key": "X-BAPI-RECV-WINDOW", 31 | "value": "{{recvWindow}}", 32 | "type": "text" 33 | }, 34 | { 35 | "key": "X-BAPI-SIGN", 36 | "value": "{{signature}}", 37 | "type": "text" 38 | }, 39 | { 40 | "key": "Content-Type", 41 | "value": "application/json", 42 | "type": "text" 43 | } 44 | ], 45 | "body": { 46 | "mode": "raw", 47 | "raw": "" 48 | }, 49 | "url": { 50 | "raw": "{{url}}/fht/compliance/tax/v3/private/registertime", 51 | "host": [ 52 | "{{url}}" 53 | ], 54 | "path": [ 55 | "fht", 56 | "compliance", 57 | "tax", 58 | "v3", 59 | "private", 60 | "registertime" 61 | ] 62 | } 63 | }, 64 | "response": [] 65 | }, 66 | { 67 | "name": "Request Export Report", 68 | "request": { 69 | "method": "POST", 70 | "header": [ 71 | { 72 | "key": "X-BAPI-SIGN", 73 | "value": "{{signature}}", 74 | "type": "text" 75 | }, 76 | { 77 | "key": "X-BAPI-API-KEY", 78 | "value": "{{bybit-api-key}}", 79 | "type": "text" 80 | }, 81 | { 82 | "key": "X-BAPI-TIMESTAMP", 83 | "value": "{{timestamp}}", 84 | "type": "text" 85 | }, 86 | { 87 | "key": "X-BAPI-RECV-WINDOW", 88 | "value": "{{recvWindow}}", 89 | "type": "text" 90 | }, 91 | { 92 | "key": "X-BAPI-SIGN", 93 | "value": "{{signature}}", 94 | "type": "text" 95 | }, 96 | { 97 | "key": "Content-Type", 98 | "value": "application/json", 99 | "type": "text" 100 | } 101 | ], 102 | "body": { 103 | "mode": "raw", 104 | "raw": "{\r\n \"type\": \"TRADE\",\r\n \"number\":\"2\",\r\n \"startTime\": \"1718143200\",\r\n \"endTime\": \"1718283600\"\r\n}" 105 | }, 106 | "url": { 107 | "raw": "{{url}}/fht/compliance/tax/v3/private/create", 108 | "host": [ 109 | "{{url}}" 110 | ], 111 | "path": [ 112 | "fht", 113 | "compliance", 114 | "tax", 115 | "v3", 116 | "private", 117 | "create" 118 | ] 119 | } 120 | }, 121 | "response": [] 122 | }, 123 | { 124 | "name": "Get Export Report Status", 125 | "request": { 126 | "method": "POST", 127 | "header": [ 128 | { 129 | "key": "X-BAPI-SIGN", 130 | "value": "{{signature}}", 131 | "type": "text" 132 | }, 133 | { 134 | "key": "X-BAPI-API-KEY", 135 | "value": "{{bybit-api-key}}", 136 | "type": "text" 137 | }, 138 | { 139 | "key": "X-BAPI-TIMESTAMP", 140 | "value": "{{timestamp}}", 141 | "type": "text" 142 | }, 143 | { 144 | "key": "X-BAPI-RECV-WINDOW", 145 | "value": "{{recvWindow}}", 146 | "type": "text" 147 | }, 148 | { 149 | "key": "X-BAPI-SIGN", 150 | "value": "{{signature}}", 151 | "type": "text" 152 | }, 153 | { 154 | "key": "Content-Type", 155 | "value": "application/json", 156 | "type": "text" 157 | } 158 | ], 159 | "body": { 160 | "mode": "raw", 161 | "raw": "{\r\n \"queryId\": \"12312312415325325\"\r\n}" 162 | }, 163 | "url": { 164 | "raw": "{{url}}/fht/compliance/tax/v3/private/status", 165 | "host": [ 166 | "{{url}}" 167 | ], 168 | "path": [ 169 | "fht", 170 | "compliance", 171 | "tax", 172 | "v3", 173 | "private", 174 | "status" 175 | ] 176 | } 177 | }, 178 | "response": [] 179 | }, 180 | { 181 | "name": "Retrieve Data Export", 182 | "request": { 183 | "method": "POST", 184 | "header": [ 185 | { 186 | "key": "X-BAPI-SIGN", 187 | "value": "{{signature}}", 188 | "type": "text" 189 | }, 190 | { 191 | "key": "X-BAPI-API-KEY", 192 | "value": "{{bybit-api-key}}", 193 | "type": "text" 194 | }, 195 | { 196 | "key": "X-BAPI-TIMESTAMP", 197 | "value": "{{timestamp}}", 198 | "type": "text" 199 | }, 200 | { 201 | "key": "X-BAPI-RECV-WINDOW", 202 | "value": "{{recvWindow}}", 203 | "type": "text" 204 | }, 205 | { 206 | "key": "X-BAPI-SIGN", 207 | "value": "{{signature}}", 208 | "type": "text" 209 | }, 210 | { 211 | "key": "Content-Type", 212 | "value": "application/json", 213 | "type": "text" 214 | } 215 | ], 216 | "body": { 217 | "mode": "raw", 218 | "raw": "{\r\n \"queryId\": \"12312312415325325\"\r\n}" 219 | }, 220 | "url": { 221 | "raw": "{{url}}/fht/compliance/tax/v3/private/url", 222 | "host": [ 223 | "{{url}}" 224 | ], 225 | "path": [ 226 | "fht", 227 | "compliance", 228 | "tax", 229 | "v3", 230 | "private", 231 | "url" 232 | ] 233 | } 234 | }, 235 | "response": [] 236 | } 237 | ], 238 | "event": [ 239 | { 240 | "listen": "prerequest", 241 | "script": { 242 | "type": "text/javascript", 243 | "packages": {}, 244 | "exec": [ 245 | "const ts = Date.now();\r", 246 | "console.log(ts.toString)\r", 247 | "\r", 248 | "pm.environment.set(\"timestamp\", ts);\r", 249 | "pm.environment.set(\"recvWindow\", 5000);\r", 250 | "let paramsObject = {};\r", 251 | "\r", 252 | "const bybit_api_secret = pm.environment.get(\"bybit-api-secret\");\r", 253 | "\r", 254 | "if (pm.request.method == \"POST\") {\r", 255 | " var queryString = \"\"\r", 256 | " queryString=ts.toString()+pm.environment.get(\"bybit-api-key\")+pm.environment.get(\"recvWindow\").toString()+pm.request.body.raw;\r", 257 | " console.log(queryString);\r", 258 | " const signature = CryptoJS.HmacSHA256(queryString, bybit_api_secret).toString();\r", 259 | " pm.environment.set(\"signature\", signature);\r", 260 | "}\r", 261 | "else{\r", 262 | " const queryString = ts.toString()+pm.environment.get(\"bybit-api-key\")+pm.environment.get(\"recvWindow\").toString()+pm.request.url.query;\r", 263 | " console.log(queryString);\r", 264 | " const signature = CryptoJS.HmacSHA256(queryString, bybit_api_secret).toString();\r", 265 | " pm.environment.set(\"signature\", signature);\r", 266 | "}" 267 | ] 268 | } 269 | }, 270 | { 271 | "listen": "test", 272 | "script": { 273 | "type": "text/javascript", 274 | "packages": {}, 275 | "exec": [ 276 | "" 277 | ] 278 | } 279 | } 280 | ] 281 | } --------------------------------------------------------------------------------