---
description: >-
  This guide will show you how can you use API to ping your SIM card IP address.
  Ping is very useful to check if SIM card is still active and can be used to
  prevent from being purged from network.
---

# Ping Thing IP Address

## Ping IP address

<mark style="color:green;">`POST`</mark> `https://console.monogoto.io/thing/ThingId_ICCID_{ICCID}/ping`

#### Path Parameters

| Name                                    | Type   | Description           |
| --------------------------------------- | ------ | --------------------- |
| ICCID<mark style="color:red;">\*</mark> | String | The ICCID of your SIM |

#### Headers

| Name                                          | Type   | Description               |
| --------------------------------------------- | ------ | ------------------------- |
| YOUR\_TOKEN<mark style="color:red;">\*</mark> | String | Your authentication token |
| CUSTOMER\_ID                                  | String | Customer API key          |

#### Request Body

| Name                                                 | Type   | Description         |
| ---------------------------------------------------- | ------ | ------------------- |
| THING\_IP\_ADDRESS<mark style="color:red;">\*</mark> | String | IP address of Thing |

{% tabs %}
{% tab title="200: OK OK" %}
```javascript
[
  {
    "alarmId": "string",
    "alarmDescription": "string",
    "Alert": {},
    "Thing": {},
    "ThingsGroupName": "string",
    "NetworkId": "string",
    "NetworkName": "string",
    "TelephonyProfileId": "string",
    "TelephonyProfileName": "string",
    "CloseTime": "2022-05-30T11:32:12.180Z",
    "Owner": "string",
    "Status": "Active"
  }
]

```
{% endtab %}

{% tab title="400: Bad Request Invalid Input Data" %}
```javascript
{
    // Response
}
```
{% endtab %}

{% tab title="401: Unauthorized Unauthorized" %}
```javascript
{
    // Response
}
```
{% endtab %}

{% tab title="404: Not Found Not found" %}
```javascript
{
    // Response
}
```
{% endtab %}

{% tab title="500: Internal Server Error Internal Server Error" %}
```javascript
{
    // Response
}
```
{% endtab %}
{% endtabs %}

{% hint style="info" %}
To get the Thing IP address, see [Get Thing information](how-to-obtain-thing-ip-address)
{% endhint %}

### Example using **cURL**:

```bash
curl -X POST \
    --url "https://console.monogoto.io/thing/ThingId_ICCID_{ICCID}/ping" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer {TOKEN_HERE}" \
    -H "apikey: {Customer ID}" \
    -d "{ \"IPAddress\": \"{THING_IP_ADDRESS}\"}"
```

{% hint style="info" %}
The above shown command needs to be replaced with information: \
&#xNAN;**{ICCID}** - replace with your Monogoto Thing ICCID number\
&#xNAN;**{TOKEN\_HERE}** - replace with your token\
&#xNAN;**{CUSTOMER\_ID}** - (optional) replace with your customer ID. It can be received together with a [Login Token](../how-to-obtain-login-token) or from request to obtain [Thing information](how-to-obtain-thing-ip-address).\
&#xNAN;**{THING\_IP\_ADDRESS}** - replace with your thing IP address\
\
If needed this API can be tested and used in the Monogoto portal following this path:\
**Thing** POST /thing/{ThingId}/ping
{% endhint %}

**Example request:**

```bash
curl -X POST \
    --url "https://console.monogoto.io/thing/ThingId_ICCID_8912372646888991/ping" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer eyJhbGciOiJIUzI1N2R5cCI6IkpXVCJ9.eyJSb2x5oiVXNlclByb2ZpbGVJZF9kZGM2MThhNC0wNTI1LTQ2MmUtYtNlNt03NzhhMGQxYmQyNGYiLCJSZWFsiSI6ImFkbWluIiwiQ3VzdG9tZXJJZfI6bnVsbCwiVXNlcklkIjoiVXNlcklkXzg52OG486TUwZjUtNDQ1Ny05NThhLTEzZjA0MzJhZDE3YyIsImp3dGlkIjoiZjE0iMzZWYtZjViNC00MzQ1LWFlZWQag1YWM1NWUzNjQ5IiwiaWF0IjoxN784MTA2LCJleHAiOjE2MDMyMTI15DZ9.7U26dqOGSz-4qZJaG6bC4J6--0x3-_6dAWLRTALXMAk" \
    -H "apikey: cid_c256463da-742-491b-911b-8850177ef5121" \
    -d "{ \"IPAddress\": \"10.140.90.211\"}"
```

**Example response:**

```json
[
  {
    "host": "11.111.11.211",
    "size": "56",
    "ttl": "63",
    "time": "82ms",
    "sent": "1",
    "received": "1",
    "packetLoss": "0"
  },
  {
    "host": "11.111.11.211",
    "size": "56",
    "ttl": "60",
    "time": "89ms",
    "sent": "2",
    "received": "2",
    "packetLoss": "0"
  },
  {
    "host": "11.111.11.211",
    "size": "56",
    "ttl": "73",
    "time": "60ms",
    "sent": "3",
    "received": "3",
    "packetLoss": "0"
  }
]
```

{% openapi src="https://3922449203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0mPxGpottOEfcucXOR%2Fuploads%2FXtNpEMk17YOUrC39Cmvr%2FJPU_CustomerAPIV_Without_Test%20it.yaml?alt=media&token=09b74b38-dd09-4edc-8f98-4df792b3c986" path="/thing/{ThingId}/ping" method="post" %}
[JPU_CustomerAPIV_Without_Test it.yaml](https://3922449203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0mPxGpottOEfcucXOR%2Fuploads%2FXtNpEMk17YOUrC39Cmvr%2FJPU_CustomerAPIV_Without_Test%20it.yaml?alt=media&token=09b74b38-dd09-4edc-8f98-4df792b3c986)
{% endopenapi %}
