> For the complete documentation index, see [llms.txt](https://docs.antares.id/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.antares.id/en/api-or-http/device.md).

# Device

### Create

* **Request**

{% tabs %}
{% tab title="JSON" %}

<table data-header-hidden><thead><tr><th width="149"></th><th width="569.3333333333334"></th></tr></thead><tbody><tr><td><strong>Field</strong></td><td><strong>Value</strong></td></tr><tr><td>URL</td><td><mark style="color:red;"><code>https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name</code></mark><br>or<br><mark style="color:red;"><code>https://platform.antares.id:8443/~/antares-cse/your-application-ID</code></mark><br><br>Note: <mark style="color:red;"><code>your-application-ID</code></mark> must be starting with <mark style="color:red;"><code>CAE</code>. e.g. <code>CAE760571675</code></mark></td></tr><tr><td>Method</td><td><mark style="color:red;"><code>POST</code></mark></td></tr></tbody></table>

**Header**

<table><thead><tr><th width="276"></th><th></th></tr></thead><tbody><tr><td><strong>Key</strong></td><td><strong>Value</strong></td></tr><tr><td>X-M2M-Origin</td><td><mark style="color:red;"><code>antares-access-key</code></mark></td></tr><tr><td>Content-Type</td><td><mark style="color:red;"><code>application/json;ty=3</code></mark></td></tr><tr><td>Accept</td><td><mark style="color:red;"><code>application/json</code></mark></td></tr><tr><td>X-ANTARES-Package</td><td><mark style="color:red;"><code>your-package-ID</code></mark></td></tr></tbody></table>

**Body**

{% code lineNumbers="true" %}

```json
{
    "m2m:cnt": {
    "rn": "your-device-name"
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="XML" %}

<table data-header-hidden><thead><tr><th width="118"></th><th width="569.3333333333334"></th></tr></thead><tbody><tr><td><strong>Field</strong></td><td><strong>Value</strong></td></tr><tr><td>URL</td><td><mark style="color:red;"><code>https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name</code></mark><br>or<br><mark style="color:red;"><code>https://platform.antares.id:8443/~/antares-cse/your-application-ID</code></mark><br><br>Note: <mark style="color:red;"><code>your-application-ID</code></mark> must be starting with <mark style="color:red;"><code>CAE</code>. e.g. <code>CAE760571675</code></mark></td></tr><tr><td>Method</td><td><mark style="color:red;"><code>POST</code></mark></td></tr></tbody></table>

**Header**

<table><thead><tr><th width="222"></th><th></th></tr></thead><tbody><tr><td><strong>Key</strong></td><td><strong>Value</strong></td></tr><tr><td>X-M2M-Origin</td><td><mark style="color:red;"><code>antares-access-key</code></mark></td></tr><tr><td>Content-Type</td><td><mark style="color:red;"><code>application/xml;ty=3</code></mark></td></tr><tr><td>Accept</td><td><mark style="color:red;"><code>application/xml</code></mark></td></tr><tr><td>X-ANTARES-Package</td><td><mark style="color:red;"><code>ID-paket-anda</code></mark></td></tr></tbody></table>

**Body**

{% code lineNumbers="true" %}

```xml
<m2m:cnt xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="your-device-name">
</m2m:cnt>
```

{% endcode %}
{% endtab %}
{% endtabs %}

**Note!!**\
**Key adalah nama variable sedangkan value adalah nilai dari variable tersebut.**

* **Response**

{% tabs %}
{% tab title="JSON" %}
{% code lineNumbers="true" %}

```json
{
    "m2m:cnt": {
        "rn": "learnLora",
        "ty": 3,
        "ri": "/antares-cse/cnt-456680027",
        "pi": "/antares-cse/CAE492050112",
        "ct": "20191119T162939",
        "lt": "20191119T162939",
        "acpi": [
            "/antares-cse/acp-35730207",
            "/antares-cse/acp-891035820"
        ],
        "et": "20201119T162939",
        "st": 0,
        "mni": 30000000,
        "mbs": 10000,
        "mia": 0,
        "cni": 0,
        "cbs": 0,
        "ol": "/antares-cse/antares-id/your-application-name/you-device-name/ol",
        "la": "/antares-cse/antares-id/your-application-name/you-device-name/la"
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="XML" %}
{% code lineNumbers="true" %}

```xml
<?xml version="1.0" encoding="UTF-8"?>
<m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:hd="http://www.onem2m.org/
xml/protocols/homedomain" rn="cin_178578843">
    <ty>4</ty>
    <ri>/antares-cse/cin-178578843</ri>
    <pi>/antares-cse/cnt-995741382</pi>
    <ct>20191119T171604</ct>
    <lt>20191119T171604</lt>
    <st>0</st>
    <cnf>text/plain:0</cnf>
    <cs>100</cs>
    <con><obj>
        <num key1="value1"/>
        <str key2="value2"/>
        <bool keyN="valueN"/>
    </obj></con>
</m2m:cin>
```

{% endcode %}
{% endtab %}
{% endtabs %}

### **Retrieve All Devices ID of a Particular Application**

* **Request**

{% tabs %}
{% tab title="JSON" %}

<table data-header-hidden><thead><tr><th width="149"></th><th width="569.3333333333334"></th></tr></thead><tbody><tr><td><strong>Field</strong></td><td><strong>Value</strong></td></tr><tr><td>URL</td><td><mark style="color:red;"><code>https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name?fu=1&#x26;ty=3</code></mark><br>or<br><mark style="color:red;"><code>https://platform.antares.id:8443/~/antares-cse/your-application-ID?fu=1&#x26;ty=3</code></mark><br><br>Note: <mark style="color:red;"><code>your-application-ID</code></mark> must be starting <mark style="color:red;"><code>CAE</code>. e.g. <code>CAE760571675</code></mark></td></tr><tr><td>Method</td><td><mark style="color:red;"><code>GET</code></mark></td></tr></tbody></table>

**Header**

<table><thead><tr><th width="276"></th><th></th></tr></thead><tbody><tr><td><strong>Key</strong></td><td><strong>Value</strong></td></tr><tr><td>X-M2M-Origin</td><td><mark style="color:red;"><code>antares-access-key</code></mark></td></tr><tr><td>Content-Type</td><td><mark style="color:red;"><code>application/json</code></mark></td></tr><tr><td>Accept</td><td><mark style="color:red;"><code>application/json</code></mark></td></tr></tbody></table>
{% endtab %}

{% tab title="XML" %}

<table data-header-hidden><thead><tr><th width="121"></th><th width="569.3333333333334"></th></tr></thead><tbody><tr><td><strong>Field</strong></td><td><strong>Value</strong></td></tr><tr><td>URL</td><td><mark style="color:red;"><code>https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name?fu=1&#x26;ty=3</code></mark><br>or<br><mark style="color:red;"><code>https://platform.antares.id:8443/~/antares-cse/your-application-ID?fu=1&#x26;ty=3</code></mark><br><br>Note: <mark style="color:red;"><code>your-application-ID</code></mark> must be starting <mark style="color:red;"><code>CAE</code>. e.g. <code>CAE760571675</code></mark></td></tr><tr><td>Method</td><td><mark style="color:red;"><code>GET</code></mark></td></tr></tbody></table>

**Header**

<table><thead><tr><th width="213"></th><th></th></tr></thead><tbody><tr><td><strong>Key</strong></td><td><strong>Value</strong></td></tr><tr><td>X-M2M-Origin</td><td><mark style="color:red;"><code>antares-access-key</code></mark></td></tr><tr><td>Content-Type</td><td><mark style="color:red;"><code>application/xml</code></mark></td></tr><tr><td>Accept</td><td><mark style="color:red;"><code>application/xml</code></mark></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

* **Response**

{% tabs %}
{% tab title="JSON" %}

```json
{
    "m2m:uril": [
        "/antares-cse/antares-id/your-application-name/you-device-name",
        "/antares-cse/antares-id/your-application-name/you-device-name2",
    ]
}
```

{% endtab %}

{% tab title="XML" %}
{% code lineNumbers="true" %}

```xml
<?xml version="1.0" encoding="UTF-8"?>
<m2m:uril xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:hd="http://www.onem2m.org/
xml/protocols/homedomain">/antares-cse/antares-id/your-application-name/your-device-name
/antares-cse/antares-id/your-application-name/your-device-name2
</m2m:uril>
```

{% endcode %}
{% endtab %}
{% endtabs %}

### **Retrieve a Particular Device**

* **Request**

{% tabs %}
{% tab title="JSON" %}

<table data-header-hidden><thead><tr><th width="149"></th><th width="569.3333333333334"></th></tr></thead><tbody><tr><td><strong>Field</strong></td><td><strong>Value</strong></td></tr><tr><td>URL</td><td><mark style="color:red;"><code>https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-device-name</code></mark><br>or<br><mark style="color:red;"><code>https://platform.antares.id:8443/~/antares-cse/your-device-ID</code></mark><br><br>Note: <mark style="color:red;"><code>your-device-id</code></mark> must be starting with <mark style="color:red;"><code>CNT-842419289</code></mark></td></tr><tr><td>Method</td><td><mark style="color:red;"><code>GET</code></mark></td></tr></tbody></table>

**Header**

<table><thead><tr><th width="276"></th><th></th></tr></thead><tbody><tr><td><strong>Key</strong></td><td><strong>Value</strong></td></tr><tr><td>X-M2M-Origin</td><td><mark style="color:red;"><code>antares-access-key</code></mark></td></tr><tr><td>Content-Type</td><td><mark style="color:red;"><code>application/json</code></mark></td></tr><tr><td>Accept</td><td><mark style="color:red;"><code>application/json</code></mark></td></tr></tbody></table>
{% endtab %}

{% tab title="XML" %}

<table data-header-hidden><thead><tr><th width="121"></th><th width="569.3333333333334"></th></tr></thead><tbody><tr><td><strong>Field</strong></td><td><strong>Value</strong></td></tr><tr><td>URL</td><td><mark style="color:red;"><code>https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-device-name</code></mark><br>or<br><mark style="color:red;"><code>https://platform.antares.id:8443/~/antares-cse/your-device-ID</code></mark><br><br>Note: <mark style="color:red;"><code>your-device-id</code></mark> must be starting with <mark style="color:red;"><code>CNT-842419289</code></mark></td></tr><tr><td>Method</td><td><mark style="color:red;"><code>GET</code></mark></td></tr></tbody></table>

**Header**

<table><thead><tr><th width="213"></th><th></th></tr></thead><tbody><tr><td><strong>Key</strong></td><td><strong>Value</strong></td></tr><tr><td>X-M2M-Origin</td><td><mark style="color:red;"><code>antares-access-key</code></mark></td></tr><tr><td>Content-Type</td><td><mark style="color:red;"><code>application/xml</code></mark></td></tr><tr><td>Accept</td><td><mark style="color:red;"><code>application/xml</code></mark></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

* **Response**

{% tabs %}
{% tab title="JSON" %}

```json
{
    "m2m:cnt": {
        "rn": "your-device-name",
        "ty": 3,
        "ri": "/antares-cse/cnt-456680027",
        "pi": "/antares-cse/CAE492050112",
        "ct": "20191119T162939",
        "lt": "20191119T162939",
        "acpi": [
            "/antares-cse/acp-35730207",
            "/antares-cse/acp-891035820"
        ],
        "et": "20201119T162939",
        "st": 0,
        "mni": 30000000,
        "mbs": 10000,
        "mia": 0,
        "cni": 0,
        "cbs": 0,
        "ol": "/antares-cse/antares-id/your-application-name/your-device-name/ol",
        "la": "/antares-cse/antares-id/your-application-name/your-device-name/la"
    }
}
```

{% endtab %}

{% tab title="XML" %}
{% code lineNumbers="true" %}

```xml
<?xml version="1.0" encoding="UTF-8"?>
<m2m:cnt xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:hd="http://www.onem2m.org/xml/
protocols/homedomain" rn="your-device-name">
    <ty>3</ty>
    <ri>/antares-cse/cnt-456680027</ri>
    <pi>/antares-cse/CAE492050112</pi>
    <ct>20191119T162939</ct>
    <lt>20191119T162939</lt>
    <acpi>/antares-cse/acp-35730207</acpi>
    <acpi>/antares-cse/acp-891035820</acpi>
    <et>20201119T162939</et>
    <st>0</st>
    <mni>30000000</mni>
    <mbs>10000</mbs>
    <mia>0</mia>
    <cni>0</cni>
    <cbs>0</cbs>
    <ol>/antares-cse/antares-id/your-application-name/your-device-name/ol</ol>
    <la>/antares-cse/antares-id/your-application-name/your-device-name/la</la>
</m2m:cnt>>
```

{% endcode %}
{% endtab %}
{% endtabs %}

### **Update Label of Device**

* **Request**

{% tabs %}
{% tab title="JSON" %}

<table data-header-hidden><thead><tr><th width="149"></th><th width="569.3333333333334"></th></tr></thead><tbody><tr><td><strong>Field</strong></td><td><strong>Value</strong></td></tr><tr><td>URL</td><td><mark style="color:red;"><code>https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-device-name</code></mark><br>or<br><mark style="color:red;"><code>https://platform.antares.id:8443/~/antares-cse/your-device-ID</code></mark><br><br>Note: <mark style="color:red;"><code>your-device-id</code></mark> must be starting with <mark style="color:red;"><code>CAE760571675</code></mark></td></tr><tr><td>Method</td><td><mark style="color:red;"><code>PUT</code></mark></td></tr></tbody></table>

**Header**

<table><thead><tr><th width="276"></th><th></th></tr></thead><tbody><tr><td><strong>Key</strong></td><td><strong>Value</strong></td></tr><tr><td>X-M2M-Origin</td><td><mark style="color:red;"><code>antares-access-key</code></mark></td></tr><tr><td>Content-Type</td><td><mark style="color:red;"><code>application/json;ty=3</code></mark></td></tr><tr><td>Accept</td><td><mark style="color:red;"><code>application/json</code></mark></td></tr></tbody></table>

**Body**

{% code lineNumbers="true" %}

```json
{
    "m2m:cnt": {
    "lbl": ["your-device-label1", "your-device-label2", "...etc"]
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="XML" %}

<table data-header-hidden><thead><tr><th width="128"></th><th width="569.3333333333334"></th></tr></thead><tbody><tr><td><strong>Field</strong></td><td><strong>Value</strong></td></tr><tr><td>URL</td><td><mark style="color:red;"><code>https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-device-name</code></mark><br>or<br><mark style="color:red;"><code>https://platform.antares.id:8443/~/antares-cse/your-device-ID</code></mark><br><br>Note: <mark style="color:red;"><code>your-device-id</code></mark> must be starting with <mark style="color:red;"><code>CAE760571675</code></mark></td></tr><tr><td>Method</td><td><mark style="color:red;"><code>PUT</code></mark></td></tr></tbody></table>

**Header**

<table><thead><tr><th width="213"></th><th></th></tr></thead><tbody><tr><td><strong>Key</strong></td><td><strong>Value</strong></td></tr><tr><td>X-M2M-Origin</td><td><mark style="color:red;"><code>antares-access-key</code></mark></td></tr><tr><td>Content-Type</td><td><mark style="color:red;"><code>application/xml;ty=3</code></mark></td></tr><tr><td>Accept</td><td><mark style="color:red;"><code>application/xml</code></mark></td></tr></tbody></table>

**Body**

{% code lineNumbers="true" %}

```xml
<m2m:cnt xmlns:m2m="http://www.onem2m.org/xml/protocols">
    <lbl>your-device-label1</lbl>
    <lbl>your-device-label2</lbl>
    <lbl>...etc</lbl>
</m2m:cnt>
```

{% endcode %}
{% endtab %}
{% endtabs %}

* **Response**

{% tabs %}
{% tab title="JSON" %}

```json
{
    "m2m:cnt": {
        "lt": "20220810T150442",
        "lbl": [
            "your-device-label1",
            "your-device-label2",
            "...etc"
        ],
        "st": 4
    }
}
```

{% endtab %}

{% tab title="XML" %}
{% code lineNumbers="true" %}

```xml
<?xml version="1.0" encoding="UTF-8"?>
<m2m:cnt xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:hd="http://www.onem2m.org/xml/protocols/homedomain">
    <lt>20220810T144737</lt>
    <lbl>your-device-label1 your-device-label2 ...etc</lbl>
    <st>3</st>
</m2m:cnt>
```

{% endcode %}
{% endtab %}
{% endtabs %}

### **Delete a Particular Device**

* **Request**

{% tabs %}
{% tab title="JSON" %}

<table data-header-hidden><thead><tr><th width="149"></th><th width="569.3333333333334"></th></tr></thead><tbody><tr><td><strong>Field</strong></td><td><strong>Value</strong></td></tr><tr><td>URL</td><td><mark style="color:red;"><code>https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-device-name</code></mark><br>or<br><mark style="color:red;"><code>https://platform.antares.id:8443/~/antares-cse/your-device-ID</code></mark><br><br>Note: <mark style="color:red;"><code>your-device-id</code></mark> must be starting with <mark style="color:red;"><code>CNT</code></mark>. e.g. <mark style="color:red;"><code>CNT-842419289</code></mark></td></tr><tr><td>Method</td><td><mark style="color:red;"><code>PUT</code></mark></td></tr></tbody></table>

**Header**

<table><thead><tr><th width="276"></th><th></th></tr></thead><tbody><tr><td><strong>Key</strong></td><td><strong>Value</strong></td></tr><tr><td>X-M2M-Origin</td><td><mark style="color:red;"><code>antares-access-key</code></mark></td></tr><tr><td>Content-Type</td><td><mark style="color:red;"><code>application/json</code></mark></td></tr><tr><td>Accept</td><td><mark style="color:red;"><code>application/json</code></mark></td></tr></tbody></table>
{% endtab %}

{% tab title="XML" %}

<table data-header-hidden><thead><tr><th width="108"></th><th width="569.3333333333334"></th></tr></thead><tbody><tr><td><strong>Field</strong></td><td><strong>Value</strong></td></tr><tr><td>URL</td><td><mark style="color:red;"><code>https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-device-name</code></mark><br>or<br><mark style="color:red;"><code>https://platform.antares.id:8443/~/antares-cse/your-device-ID</code></mark><br><br>Note: <mark style="color:red;"><code>your-device-id</code></mark> must be starting with <mark style="color:red;"><code>CNT</code></mark>. e.g. <mark style="color:red;"><code>CNT-842419289</code></mark></td></tr><tr><td>Method</td><td><mark style="color:red;"><code>DELETE</code></mark></td></tr></tbody></table>

**Header**

<table><thead><tr><th width="213"></th><th></th></tr></thead><tbody><tr><td><strong>Key</strong></td><td><strong>Value</strong></td></tr><tr><td>X-M2M-Origin</td><td><mark style="color:red;"><code>antares-access-key</code></mark></td></tr><tr><td>Content-Type</td><td><mark style="color:red;"><code>application/xml</code></mark></td></tr><tr><td>Accept</td><td><mark style="color:red;"><code>application/xml</code></mark></td></tr></tbody></table>
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.antares.id/en/api-or-http/device.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
