Help regarding api connect

hai all

i tried to connect to a device using below code

var settings = {
  "url": "https://api.remot3.it/apv/v27/device/connect",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "host": "api.remot3.it",
    "content-type": "application/json"
  },
  "data": JSON.stringify({
    "deviceaddress": "80:00:00:00:XX:XX:XX:XX",
    "wait": "true",
    "hostip": "0.0.0.0"
  }),
};


$.ajax(settings).done(function (response) {
  console.log(response);
});

and response is like below

{"status":"true","connection":{"deviceaddress":"80:00:00:00:XX:XX:XX:XX","status":"running","requested":"11\/17\/2021T8:36 PM","proxy":"http:\/\/proxy61.rt3.io:31452","proxyserver":"proxy61.rt3.io","proxyport":"31452","expirationsec":"28800","connectionid":"c48db86f-8d68-XXXXXXXXXXXXXXXXXXXXXX","proxyServerPort":31452,"proxyExpirationSec":28800,"sessionID":"980B668E923C87A8DB66FEDA9B8881C3F38946BF","initiator":"suryaprakashlokula@gmail.com","targetUID":"80:00:00:00:XX:XX:XX:XX","clientID":"N0JGMjU3QUItRjA2Qy00QzJDLUEyNUEtMTXXXXXXXXXXXXXX","filteredIP":"none","proxyURL":"proxy61.rt3.io:31452","reverseProxy":false,"p2pConnected":true,"serviceConnected":true,"peerReqEP":"XX.XXX.120.184:XXXXX","peerEP":"49.XXX.120.184:XXXXX","latchedIP":"0.0.0.0","initiatorUID":"f0:80:5f:2a:f0:86:e8:xx","lifeLeft":86396,"idleLeft":896,"requestedAt":"2021-11-18T01:36:00+00:00"},"wait":true,"connectionid":"c48db86f-8d68-4617-8614-xxxxxxxxxxxx"}

but video is not streaming with api but if i connect with the website connect button in Devices section all works perfect

i am i missing any thing else in api

What is the proxy connection host you are getting in the web portal vs. the API call?

e.g. proxy61, etc.

Thanks,

@gary

thanks for your fast response

from web portal the proxy url is proxy60.rt3.io:37870 its working normal
but again from api call proxy url is proxy61.rt3.io:31587 connecting and disconnecting not wrking

is that an issue getting like that

can any one help me with this issue please

Sorry I missed this. It will be faster if you send an e-mail to support@remote.it because I need to ask you to do the test/comparison again.

I don’t see anything obviously wrong in what you are doing. Is the pattern consistent? Do you always get the same proxy (if not the same port) via the API?

The reality though is that if you are trying to stream video, making a proxy connection is not the best way to do that. You should try to make peer to peer connections if possible. This usually gives best performance.

Please see:

thank you so much for your reply but now i am getting a issue like this

{'status': 'false', 'reason': 'clock skew of 3557.118s was greater than 300s', 'code': 'GENERAL_ERROR'}

i could not understand what it is

What exactly is the API call that results in this message?
Is the time on your system set properly?

@gary thank you, the date and time is same in raspberry pi and in postman, the error occurs when i request to a url given at first of this topic

@surya the REST API has been deprecated in favor of graphQL.

Please see:

If you have any issues with this please send an e-mail to support@remote.it for the quickest response.