# HTTP requests

> Using the HTTP/HTTPS Api The HTTP API allows you to send and receive requests from any service or DIY Smart Project to iotBind platform.When issuing a HTTP request, your request must be signed with Device API secret key , and include the request parameters and using the HTTP methods GET OR POST.the base URL for API version 1.0  is : http://api.iotbind.com/v1/&nbsp;&nbsp;

> To generate a API key , click on the key icon After adding the device And Click on the refresh icon To generate a new key Any time.

> 

URL API : http://api.iotbind.com/v1/tracking.php

| Parameter | Value | Description |
| --- | --- | --- |
| method | "POST" or "GET"&nbsp; | For How you want to send data ,Only Value "post" or "get"Always use it&nbsp; |
| uid | Device UniqueID | Always use it |
| key | Encrypted key | Device API secret keyAlways use it&nbsp; |
| cmd | One of these:"get""ping" | only use one of these commands when you send a requests to iotbind"get" If you want get device data frome iotBind platform"ping" If you want send ping Command to iotBind platform to learn that the device is connected |
| longitude | numbers | Use it for update longitude |
| latitude | numbers | Use it for update latitude |
| data1 | Text or numbers | (optional) Use it only for update data1 |
| data2 | Text or numbers | (optional) Use it only for update data2 |
| data3 | Text or numbers | (optional) Use it only for update data3 |
| data4 | Text or numbers | (optional) Use it only for update data3 |

Example:&nbsp;if you need to Update latitude,longitude and data1,data2,data3,data4 by URL link "GET method":http://api.iotbind.com/v1/tracking.php?method=get&amp;key={DeviceKay}&amp;uid={UniqueID}&amp;longitude={longitude}&amp;latitude={latitude}&amp;data1={Anything}&amp;data2={Anything}&amp;data3={Anything}&nbsp;&nbsp;



Output json Data :&nbsp;&nbsp;

```json
{"MESSAGE":"UPDATED"}

```

* data1,data2,data3,data4 is an optional if you need to update Any one of them

Example: if you need to get all data by "GET method":http://api.iotbind.com/v1/tracking.php?method=get&amp;key={DeviceKay}&amp;uid={UniqueID}&amp;cmd=get





replace:{DeviceKay} = API Device Kay{UniqueID} = Device UniqueID

Output json Data :

&nbsp;&nbsp;

```json
{
    "uid": "UniqueID",
    "name": "DeviceName",
    "type": "Phone app tracking",
    "longitude": "17.6359479",
    "latitude": "44.5318535",
    "data1": "Anything",
    "data1_unit": "Anything",
    "data2": "Anything",
    "data2_unit": "Anything",
    "data3": "Anything",
    "data3_unit": "Anything",
    "data4": "Anything",
    "data4_unit": "Anything"
}
```

Example: for Update latitude,longitude and data1,data2,data3 by URL link "POST method":http://api.iotbind.com/v1/tracking.php

Send POST data with request:method=postuid=UniqueIDkey=DeviceKaylongitude=17.6359479latitude=44.5318535data1=Anythingdata2=Anythingdata3=Anythingdata4=Anything

Output json Data :

&nbsp;&nbsp;

```json
{"MESSAGE":"UPDATED"}
```

* data1,data2,data3,data4 is an optional if you need to update Any one of them&nbsp;&nbsp;

Example: if you need to get all data by "POST method:http://api.iotbind.com/v1/tracking.php

Send POST data with request:

method=postuid=UniqueIDkey=DeviceKaycmd=get

Output json Data :

&nbsp;&nbsp;

```json
{
    "uid": "UniqueID",
    "name": "DeviceName",
    "type": "Phone app tracking",
    "longitude": "17.6359479",
    "latitude": "44.5318535",
    "data1": "Anything",
    "data1_unit": "Anything",
    "data2": "Anything",
    "data2_unit": "Anything",
    "data3": "Anything",
    "data3_unit": "Anything",
    "data4": "Anything",
    "data4_unit": "Anything"
}
```

If you want send "ping" Command to iotBind platform to learn that the device is connected by URL link "POST method":http://api.iotbind.com/v1/tracking.php

Send POST data with request:

method=postuid=UniqueIDkey=DeviceKaycmd=ping

Output json Data :

```json
{"MESSAGE":"PING OK"}
```

If you want send "ping" Command to iotBind platform to learn that the device is connected by URL link "GET method":http://api.iotbind.com/v1/tracking.php?method=get&amp;key={DeviceKay}&amp;uid={UniqueID}&amp;cmd=ping&nbsp;&nbsp;

replace:{DeviceKay} = API Device Kay{UniqueID} = Device UniqueID

Output json Data :

&nbsp;&nbsp;

```json
{"MESSAGE":"PING OK"}
```

