# FAQS

#### Common Issues and Solutions for API Integration with Fokawa

**1. Timestamp Parameter Difference**

**Question:** What is the maximum difference between the timestamp parameter of the request interface and the arrival time of the server?\
**Answer:** The server will consider a request invalid if the timestamp in the request is sent more than 5000 milliseconds before the request's arrival. This time window can be customized by sending the optional parameter `recvWindow`.

**2. X-CH-TS Cannot Be Empty**

**Question:** The request header "X-CH-TS" cannot be empty. How to solve it?\
**Answer:** It is recommended to print out the `X-CH-TS` and check whether it is empty when there is an exception. Optimize your code to check if the `X-CH-TS` is empty before each request.

**3. Invalid Signatures**

**Question:** Why does authentication always return invalid signatures?\
**Answer:**

* Print out the request header information and the string before the signature.
* Compare your request header with the example below:

  ```
  Content-Type: application/json
  X-CH-APIKEY: 44c541a1-****-****-****-10fe390df2
  X-CH-SIGN: ssseLeefrffraoEQ3yI9qEtI1CZ82ikZ4xSG5Kj8gnl3uw=
  X-CH-TS: 1574327555669
  ```
* Ensure the API-key is correctly configured.
* Verify the string before signing conforms to the standard format, and the order of all elements is consistent:

  ```
  GET Example: 1588591856950GET/sapi/v1/account
  POST Example: 1588591856950POST/sapi/v1/order/test{"symbol":"BTCUSDT","price":"9300","volume":"1","side":"BUY","type":"LIMIT"}
  ```

**4. ILLEGAL\_CONTENT\_TYPE (-1017)**

**Question:** The calling interface prompts ILLEGAL\_CONTENT\_TYPE (-1017). What is the reason?\
**Answer:** Attach Content-Type to all request headers and set it to `application/json`.

**5. API Call Frequency Limits**

**Question:** Is there a limit to the frequency of API calls per second?\
**Answer:** Yes, there are restrictions. Refer to the access frequency limits for each interface in the documentation.

**Question:** What is the limit on API access frequency?\
**Answer:** Personal data is restricted according to API-key, and public data is restricted according to IP. If the user requests public data and includes valid personal information, it is restricted according to API-key.

**6. HTTP Status Code 429**

**Question:** What is the cause of HTTP status code 429?\
**Answer:** The request interface exceeds the access frequency limit. Reduce the access frequency.

**Question:** Will the IP be blocked if the API call interface reports that the access frequency is exceeded? How long is it sealed?\
**Answer:** Normally not. Just reduce the access frequency.

**7. WebSocket Disconnection**

**Question:** Why is WebSocket disconnected?\
**Answer:** Without adding a heartbeat, the WebSocket connection requires the client to send a pong message to ensure stability. Network issues can also cause automatic disconnection. Implement a WebSocket disconnect and reconnect mechanism to automatically reconnect when the heartbeat connection is accidentally disconnected.

**8. Time Out Error**

**Question:** The user request interface reports an error Time Out?\
**Answer:** The network cannot connect to the server. Check whether the network is smooth.

**9. Getting All Currency Pairs**

**Question:** How to get all the currency pairs on the platform?\
**Answer:** Use the `/sapi/v1/symbols` interface.

**10. Batch Orders/Cancellations Limit**

**Question:** Is there a limit on the number of batch orders/cancellations?\
**Answer:** Yes, the batch interface will limit 10 orders.

**11. newClientOrderId**

**Question:** What is newClientOrderId and what does it do?\
**Answer:** `newClientOrderId` is your customized order number, which can be used to identify your order. Ensure this ID is unique. You can use `newClientOrderId` to call the "Order Information" interface to view the order status. If there is a repetition, you can only cancel or query the latest piece of data.

**12. Latest Transaction Price**

**Question:** How to get the latest transaction price?\
**Answer:** You can get ticker information; `last` is the latest transaction price.

**13. 24-Hour Trading Volume**

**Question:** Will there be negative growth in the 24-hour trading volume in the ticker interface?\
**Answer:** Yes, the 24-hour trading volume is a 24-hour rolling data. Negative growth may occur when the accumulated trading volume in the next window is smaller than the previous window.
