Jump to content









Photo

how to use triggers to send data to a external rest api?

triggers api

  • Please log in to reply
1 reply to this topic

#1 fuchis2

fuchis2

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 08 April 2019 - 10:55 AM

hi, im trying to create a trigger to send my data stream to a external rest api, the problem is that the data is not reaching te external api

 

if i use headers(content-type application/json) the data does not reach the api,

but if I do not use the headers, the data reaches the api

 

Captura de pantalla 2019-04-08 a la(s) 5.32.44.png
content-type application/jason
 
result:
Captura de pantalla 2019-04-08 a la(s) 5.32.19.png

data does not reach the api

 

Captura de pantalla 2019-04-08 a la(s) 5.47.47.png
no content-type
 
result:
Captura de pantalla 2019-04-08 a la(s) 5.42.22.png

data reaches the api, but as a string

 

 

 

 

sorry for my bad english, it's not my native lenguage

Attached Files



#2 dompablo

dompablo

    Master of Puppets

  • Members
  • PipPip
  • 15 posts

Posted 08 April 2019 - 03:24 PM

Hi fuchis2,

 

Try to compose a JSON in the payload field

 

instead of:
Temp=%%%value%%%

This:

{"Temp": %%%value%%%}

 

And also try to remove the semicolon in the header value application/json.

 

Regards!







Also tagged with one or more of these keywords: triggers, api

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users