{"status": "true","connectionid":"A481EBED-C678-4DA4-60D2-60F1FE8EB5DA"}
{"status": "false","reason":"<error message>"}
Note Some response values are omitted from the example above because they are only used in very specific circumstances.
#!/bin/shTOKEN="your_login_token"DEV_KEY="your_developer_key"DEVICE_ADDRESS="your_device_address"CONNECTION_ID="your_connection_id"curl -X POST \-H "token:$TOKEN" \-H "developerkey:$DEV_KEY" \-d "{\"connectionid\":\"$CONNECTION_ID\", \\"deviceaddress\":\"$DEVICE_ADDRESS\" }" \https://api.remot3.it/apv/v27/device/connect/stop
const axios = require("axios");const developerkey = process.env.REMOTEIT_DEVELOPER_KEY;const token = process.env.REMOTEIT_TOKEN;const deviceaddress = process.env.REMOTEIT_DEVICE_ADDRESS;const connectionid = process.env.REMOTEIT_CONNECTION_ID;axios.post("https://api.remot3.it/apv/v27/device/connect/stop",{ deviceaddress,connectionid},{headers: {developerkey,token}}).then(response => {console.log("Status Code:", response.status);console.log("Body:", response.data);}).catch(error => {console.log(error);});
import requestsimport jsonimport osheaders = {"developerkey": os.environ["REMOTEIT_DEVELOPER_KEY"],# Created using the login API"token": os.environ["REMOTEIT_TOKEN"]}body = {"deviceaddress": "your_device_address","connectionid": "your_connection_id"}url = "https://api.remot3.it/apv/v27/device/connect/stop"response = requests.post(url, data=json.dumps(body), headers=headers)response_body = response.json()print("Status Code: %s" % response.status_code)print("Raw Response: %s" % response.raw)print("Body: %s" % response_body)
using System;using System.Net.Http;using Newtonsoft.Json;using System.Collections.Generic;namespace remote.it_api_example{class Program{static void Main(string[] args){string jsonString = "";string url = "https://api.remot3.it/apv/v27/device/connect/stop";HttpClient client = new HttpClient();HttpRequestMessage requestData = new HttpRequestMessage();// Configure the HTTP requests's url, headers, and bodyrequestData.Method = HttpMethod.Post;requestData.RequestUri = new Uri(url);requestData.Headers.Add("developerkey", Environment.GetEnvironmentVariable("REMOTEIT_DEVELOPER_KEY"));requestData.Headers.Add("token", Environment.GetEnvironmentVariable("REMOTEIT_TOKEN"));Dictionary<string, string> bodyData = new Dictionary<string, string>() {{"deviceaddress", Environment.GetEnvironmentVariable("REMOTEIT_DEVICE_ADDRESS") },{"connectionid", Environment.GetEnvironmentVariable("REMOTEIT_CONNECTION_ID") }};string jsonFormattedBody = JsonConvert.SerializeObject(bodyData);requestData.Content = new StringContent(jsonFormattedBody);try{// Send the HTTP request and run the inner block upon recieveing a responsevar response = client.SendAsync(requestData).ContinueWith((taskMessage) =>{var result = taskMessage.Result;var jsonTask = result.Content.ReadAsStringAsync();jsonTask.Wait();// Store the body of API responsejsonString = jsonTask.Result;});response.Wait();}catch (HttpRequestException e){// Triggered when the API returns a non-200 response codejsonString = e.Message;}// Print JSON response from APIConsole.WriteLine(jsonString);}}}
<?php$ch = curl_init();curl_setopt_array($ch, array(CURLOPT_URL => "https://api.remot3.it/apv/v27/device/connect/stop",CURLOPT_HTTPHEADER => array("developerkey: ".$_ENV["REMOTEIT_DEVELOPER_KEY"],"token: ".$_ENV["REMOTEIT_TOKEN"] // Created using the login API),CURLOPT_POSTFIELDS => json_encode(array("deviceaddress" => $_ENV["REMOTEIT_DEVICE_ADDRESS"],"connectionid" => $_ENV["REMOTEIT_CONNECTION_ID"])),CURLOPT_RETURNTRANSFER => true));$response = curl_exec($ch);$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);curl_close($ch);print("Status Code: ".$statusCode."\n");$responseData = json_decode($response);print_r($responseData);?>