TargetUnreachableError - new REST API - webhookSmartApp


I am trying to register my Smart App using :

       curl -X POST \
        -H "Authorization: Bearer <my token>" \
        -H "Content-Type: application/json; charset=utf-8" \
       -d $'{"appName": "<myAppName>", "displayName": "
    <myAppDisplayName>", "description": "<my-
      Description>", "appType": "WEBHOOK_SMART_APP", 
    "webhookSmartApp": {"targetUrl": 

My server is running correctly in this time ,it is written in node but I get a
error response:

      "requestId": "dd29a5f9-7d87-7d54-8095-f6ced47bdfb0",
      "error": {
       "code": "ConstraintViolationError",
       "message": "The request is malformed.",
       "details": [
                "code": "TargetUnreachableError",
                "target": "",
                 "message": "Unable to communicate with target.",
                 "details": []

What can be reason? Is it possible that the reason is that I use localhost?

1 Like

Yes, it’s because of localhost.

For rapid prototyping/testing, I’d recommend ngrok. It’s an awesome way to create a publicly accessible URL without having to deploy to a third-party or anything like that.

Basically once installed, just ngrok http 8443, (assuming you are on port 8443) grab the public https link, and use that when registering your app.

1 Like

Thank you, I’ve never heard abour ngrok earlier , it seems to be great solution.

1 Like