# Write API

## Write Value to IoT Device

<mark style="color:blue;">`GET`</mark> `http://app.openioe.in/api/updatedevicevalue`

**Format:** <http://app.openioe.in/api/_updatedevicevalue/\\><APIKey>/\<DeviceID>/\<DevicePIN>/\<Data>\_

#### Path Parameters

| Name                                           | Type    | Description                 |
| ---------------------------------------------- | ------- | --------------------------- |
| \<APIKey><mark style="color:red;">\*</mark>    | String  | e.g.,: pnHEmHgjFl0PT247Eae9 |
| \<DeviceID><mark style="color:red;">\*</mark>  | Integer | e.g.,: 25                   |
| \<DevicePin><mark style="color:red;">\*</mark> | Integer | e.g.,: 957                  |
| \<Data><mark style="color:red;">\*</mark>      | String  | e.g.,: 99.15                |

{% tabs %}
{% tab title="200: OK Successfully updated value from write API" %}
Successfully updated value from write API
{% endtab %}
{% endtabs %}

## Write JSON to IoT Device

<mark style="color:green;">`POST`</mark> `http://app.openioe.in/api/updatedevicejson`

**Format:** <http://app.openioe.in/api/_updatedevicejson/\\><APIKey>/\<DeviceID>/\<DevicePIN>\_

#### Path Parameters

| Name                                           | Type    | Description                 |
| ---------------------------------------------- | ------- | --------------------------- |
| \<APIKey><mark style="color:red;">\*</mark>    | String  | e.g.,: pnHEmHgjFl0PT247Eae9 |
| \<DeviceID><mark style="color:red;">\*</mark>  | Integer | e.g.,: 25                   |
| \<DevicePin><mark style="color:red;">\*</mark> | Integer | e.g.,: 957                  |

#### Request Body

| Name                                      | Type | Description              |
| ----------------------------------------- | ---- | ------------------------ |
| \<Data><mark style="color:red;">\*</mark> | JSON | e.g.,: {"name": "India"} |

{% tabs %}
{% tab title="200: OK Successfully updated JSON from write API" %}
Successfully updated JSON from write API
{% endtab %}
{% endtabs %}

## Write XML to IoT Device

<mark style="color:green;">`POST`</mark> `http://app.openioe.in/api/updatedevicexml`

**Format:** <http://app.openioe.in/api/_updatedevicexml/\\><APIKey>/\<DeviceID>/\<DevicePIN>\_

#### Path Parameters

| Name                                           | Type    | Description                 |
| ---------------------------------------------- | ------- | --------------------------- |
| \<APIKey><mark style="color:red;">\*</mark>    | String  | e.g.,: pnHEmHgjFl0PT247Eae9 |
| \<DeviceID><mark style="color:red;">\*</mark>  | Integer | e.g.,: 25                   |
| \<DevicePin><mark style="color:red;">\*</mark> | Integer | e.g.,: 957                  |

#### Request Body

| Name                                      | Type | Description                   |
| ----------------------------------------- | ---- | ----------------------------- |
| \<Data><mark style="color:red;">\*</mark> | XML  | e.g.,: \<name> India\</name>} |

{% tabs %}
{% tab title="200: OK Successfully updated XML from write AP" %}
Successfully updated XML from write AP
{% endtab %}
{% endtabs %}
