< All Topics
Print

Debugging your webhook

NOTE: This is an advanced topic. Webhook trading is an automation technique that is optional, but powerful.

Your webhook has two parts: The message body, and the URL you are sending that message to. Please login to chart.observer and copy this information from your Webhook URL page. It has the correct user id and URL for your account.

Here is an example of the JSON-formatted message body:

{
"tokenpair": "{{ticker}}",
"count": 10,
"usdprice":"{{close}}",
"action": "buy",
"exchange": "{{exchange}}",
"user": "1234567890"
}

IMPORTANT: Assuming you are using Tradingview to initiate your trade alert, they will replace {{close}} with the closing price for the current candle, and the {{exchange}} will be based on the {{ticker}} you have chosen. For example, if you select SOLUSD on Coinbase as your charting source, the {{ticker}} is SOLUSD, and the {{exchange}} is “Coinbase”. Tradingview fills these values in for you, so you can literally leave that part unchanged. Always change the “count” value to how many tokens you want, and if you want to sell then change “action” to “sell” instead of “buy”.

If you are using some other charting tool or platform, you will need to provide the price and the exchange another way. When in doubt, try to use “Coinbase” as the exchange, since we pull price data from Coinbase by default for trial account holders. Users will also need to ensure you are trading a token from our list of supported cryptocurrencies, based on your account level.

Tradingview Example

In this very basic example, we will simply use a horizontal line to trigger our trade alerts. While this can be a very common and useful approach, please note that you can initiate alerts with much more sophisticated indicators and strategies.

In the video we typed-in SOLUSD. But we could have used {{ticker}} in that place instead.

If your alerts get triggered, but you do not see any trade in your chart.observer dashboard, check the following common issues:

  • The webhook URL was copied from your Webhook URL (you were logged in at the time)
  • You have valid formatted JSON (see throubleshooting tools below)
  • The trading pair is on our supported cyrptocurrency list (and has a “USD” at the end)
  • The cost of a buy order does not exceed your USD balance
  • You are not trying to “short” (sell before you buy)
  • Double check the user ID for the chart.observer account in question
  • The alert really did go off in your Tradingview alert logs

Helpful Troubleshooting Tools

Here are two free tools that you may find helpful when trying to send automated trading alerts to our API webhook. If you have already looked at the other support articles and you feel that you understand our webhook process for automating trades, then this may be the easy fix for your missing transactions.

JSONLint
https://jsonlint.com/

The message format that we require is called JSON. It’s a popular style of structuring text data so that another website can read it and understand the content. The JSONLint website lets you take the message body that you are trying to send to us and copy it into their web page to check for formatting errors.


Webhook.site
https://webhook.site

If you aren’t sure what the content of your webhook message looks like, you can point it at Webhook.site and they will intercept it. Just look for the custom webhook url that they assign you, and swap it with the one we provided you. This makes it very easy to see what we would have received, if the message made it to us. If you are talking to somebody on our tech support staff about your failed webhook trades, we may ask you to send us what you see at Webhook.site


Table of Contents