Mefree.NET API Frequently Asked Questions (FAQ)

Mefree.NET API Frequently Asked Questions (FAQ)

This FAQ provides solutions to common issues users may encounter when using the Mefree.NET API.


1. Account and Permission Issues

1.1 Why is my API key not working?

Possible Reasons:

  • The API key has been disabled or deleted.

Solutions:

  • Log in to the Mefree Telegram bot and check the status of your API key to ensure it is active.

1.2 How do I enable access for specific IP addresses only?

Solution:

  • When creating or editing your API key, specify the IP address you want to bind. This will restrict the API key to accept requests only from that IP address, enhancing security.


2. Signature and Authentication Issues

2.1 Why am I getting a 401 Unauthorized error?

Possible Reasons:

  • Incorrect MF-ACCESS-KEY or MF-ACCESS-SIGN.

  • Signature generation is incorrect.

  • Timestamp deviation exceeds 5 seconds.

Solutions:

  • Verify that the MF-ACCESS-KEY matches the provided API key.

  • Ensure the signature is generated according to the signature rules. Double-check the logic for signature generation.

  • Ensure MF-ACCESS-TIMESTAMP is a valid UTC timestamp and the deviation from server time is within 5 seconds.

2.2 How can I verify signature generation?

Solution:

  • Print the concatenated string used for signing (timestamp + method + requestPath) for debugging.

  • Compare the generated signature with one calculated manually.

    Demo:
      timestamp = "2008-08-08T08:08:08.888Z"
      method = "GET"
      requestPath = "/api/config"
      waitSigningString = "2008-08-08T08:08:08.888ZGET/api/config"
      SECRET_KEY = "8d3c3c07a47186c9d6d352d287263cf3"
    By calling the generate_signature() method in the API Demo to find out whether the signature value is equal to
      jY+BLq8s2cAFQmEDp1rbZw0PPG9Np67cmbmS7rhSdyw=
  • Use tools like Postman or Curl to manually test your signature if needed.


3. Request and Response Issues

3.1 Why am I getting a 400 Bad Request error?

Possible Reasons:

  • Missing or incorrect request parameters.

  • Incorrect API endpoint path.

Solutions:

  • Check the API documentation to ensure all required parameters and paths are correct.

  • Verify that the Content-Type header is set to application/json.

  • Ensure the request payload is properly formatted as JSON.

3.2 Why am I getting a 429 Too Many Requests error?

Possible Reasons:

  • The request frequency exceeds the API rate limits.

Solutions:

  • Review the API documentation to understand rate limits (e.g., maximum requests per second).

  • Implement throttling in your code to control the number of requests sent per second.

  • When using distributed systems, ensure the combined request rate does not exceed the limit.

3.3 Why am I getting a 500 Internal Server Error?

Possible Reasons:

  • Temporary issues with the API server.

Solutions:

  • Check your network connection to ensure the request was sent successfully.

  • Wait a few seconds and retry the request.

  • If the issue persists, contact Mefree support.


4. Specific Endpoint Issues

4.1 Why can't I successfully place an order?

Possible Reasons:

  • Insufficient account balance.

  • Incorrect order parameters (e.g., quantity or price).

  • Account lacks the required trading permissions.

Solutions:

  • Verify that your account balance is sufficient.

  • Ensure that order parameters (e.g., quantity and period) meet the minimum requirements (refer to the "Place Order" section in the documentation).


5. Development and Debugging Issues

5.1 How can I handle timeout issues?

Possible Reasons:

  • Network delays or unstable connections.

Solutions:

  • Set a longer timeout for requests (e.g., timeout=30).

  • Implement a retry mechanism for critical operations (e.g., retry 2–3 times).

  • Test your network connectivity to the Mefree API server.

5.2 How do I parse API responses?

Solution: Mefree API responses are typically in JSON format and follow this structure:

{
  "code": "0",
  "msg": "",
  "data": {
    "key": "value"
  }
}
  • code: 0 indicates success; non-zero values indicate errors.

  • data contains the main content; parse this to retrieve specific information.


6. Other Issues

6.1 Why are timestamps often incorrect?

Possible Reasons:

  • Local time is not synchronized with UTC time.

Solution:

  • Use Python’s datetime.utcnow() function or similar methods to generate UTC timestamps.

6.2 How do I handle API upgrades?

Solution:

  • Subscribe to Mefree’s developer announcements for updates on API changes.

  • Periodically update your code to accommodate the latest API versions.

  • Use versioning (e.g., v1) in your code to avoid compatibility issues during upgrades.

6.3 Failed -Out of Energy

Possible Reasons:

When transferring USDT (TRC20) on the TRON network:

  • If the recipient's address already holds USDT, the transaction requires 65,000 energy.

  • If the recipient's address does not hold USDT, the transaction requires 131,000 energy.


7. Contact Support

If you cannot resolve an issue, contact Mefree technical support through the following channels:


This FAQ aims to help you quickly resolve common issues when using the Mefree API. Happy coding! 🚀

Last updated