Can't get Argo tunnel status using API

I’m new and have never used the API. I want to get the status of my tunnel - Active or Inactive. According to the API documentation, you need to send such a request

curl -X GET "`https://api.cloudflare.com/client/v4/accounts/699d98642c564d2e855e9661899b7252/cfd_tunnel?name=blog&uuid=f70ff985-a4ef-4643-bbbc-4a0ed4fc8415&is_deleted=true&existed_at=2019-10-12T07:20:50.52Z&page=1&per_page=undefined" \`
     -H "X-Auth-Email: [email protected]" \
     -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41" \
     -H "Content-Type: application/json"

To get that answer

{
  "success": true,
  "errors": [],
  "messages": [],
  "result": [
    {
      "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
      "account_tag": "699d98642c564d2e855e9661899b7252",
      "created_at": "2021-01-25T18:22:34.317854Z",
      "deleted_at": "2009-11-10T23:00:00Z",
      "name": "blog",
      "connections": [
        {
          "colo_name": "DFW",
          "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925",
          "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925",
          "is_pending_reconnect": false,
          "origin_ip": "85.12.78.6",
          "opened_at": "2021-01-25T18:22:34.317854Z",
          "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925",
          "client_version": "2022.7.1"
        }
      ],
      "conns_active_at": "2009-11-10T23:00:00Z",
      "conns_inactive_at": "2009-11-10T23:00:00Z",
      "tun_type": "cfd_tunnel",
      "metadata": {},
      "status": "active",
      "remote_config": true
    }
  ]
}

I am sending such a request through Postman Online

https://api.cloudflare.com/client/v4/accounts/d53e57f7dfc47ec54f67ed3d09967a6f/cfd_tunnel?name=ha&uuid=fff3ee88-9f2c-421d-8011-2f4a02122390&is_deleted=false&existed_at=2022-12-04T07:20:50.52Z&page=1&per_page=undefined

For X-Auth-Email, I use the Cloudflare login email
For X-Auth-Key I use Global API Key https://dash.cloudflare.com/profile/api-tokens
I leave Content-Type: application/json unchanged

As a result, I get an error

{
    "success": false,
    "errors": [
        {
            "code": 1030,
            "message": "Could not parse input. Query deserialize error: invalid digit found in string"
        }
    ],
    "messages": [],
    "result": null
}

Your GET looks too complicated. It only needs the tunnel ID at the end.

https://developers.cloudflare.com/api/operations/cloudflare-tunnel-get-a-cloudflare-tunnel

Request
https://api.cloudflare.com/client/v4/accounts/d53e57f7dfc47ec54f67ed3d09967a6f/fff3ee88-9f2c-421d-8011-2f4a02122390

Response

{
    "success": false,
    "errors": [
        {
            "code": 7003,
            "message": "Could not route to /accounts/d53e57f7dfc47ec54f67ed3d09967a6f/fff3ee88-9f2c-421d-8011-2f4a02122390, perhaps your object identifier is invalid?"
        },
        {
            "code": 7000,
            "message": "No route for that URI"
        }
    ],
    "messages": [],
    "result": null
}

did i specify cfd_tunnel correctly?

You’re missing the /cfd_tunnel/ portion of the path. Please check the API link I posted again. Here’s my Postman GET request:

https://api.cloudflare.com/client/v4/accounts/{{account_id}}/cfd_tunnel/{{tunnel_id}}

2 Likes

Thanks a lot it worked!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.