Jump to content









Photo

Telenet POST strems

POST Unauthorized

  • Please log in to reply
1 reply to this topic

#1 dnsisrt1

dnsisrt1

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 22 January 2018 - 10:25 PM

Hi.

 

Is there a way to test a POST stream just to kwon syntax is correct? I am trying but I get 401 Unauthorized {"response": "No supported payload"}

 

Thanks in advance.



#2 Yoleon

Yoleon

    Sugar Master

  • Members
  • PipPipPip
  • 42 posts

Posted 24 January 2018 - 09:27 AM

Hi dnsistr1,

 

I tried a simple code to send stream through telnet and it works, i leave the code here:

 

Execute telnet

 

telnet api.carriots.com 80

 

And then use this code adding your apikey, the device id_devloper and the length of your data

 

POST /streams HTTP/1.1
Host: api.carriots.com
Accept: application/json
User-Agent: Stream-Carriots
Content-Type: application/json
carriots.apikey: YOUR APIKEY
Content-Length: LENGTH OF DATA
Connection: close

{
"protocol":"v2",
"device":"YOUR DEVIVE ID_DEVELOPER",
"at":"now",
"data":{"light":"ON"}
}

 

I hope this help you,

 

Carriots Staff






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users