# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.openioe.in/api-references/write-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
