@Jhonatan Juno
Hello,
I’m recently testing TagoCore, but I’m having doubts, I see that there is no way to select connectors, so I don’t see any way to insert data. Any idea how to do this? I would like to be able to start testing with this new
@Jhonatan Juno
Hello,
I’m recently testing TagoCore, but I’m having doubts, I see that there is no way to select connectors, so I don’t see any way to insert data. Any idea how to do this? I would like to be able to start testing with this new
@Matheus Benachio
Hi jjuno,
Currently, you cannot use connectors in TagoCore.
Once you click on “Create a device”, a blank device will be created for you to use. You can use the device’s token in order to send a POST request to the /data route and insert data into the bucket.
You may also define a payload parser file in the device page in order to manually parse the data coming from your devices.
We are actively looking into integrating the connector system with TagoCore, but I cannot provide an ETA for the integration.
Let me know if you need more details,
Matt.
@Jhonatan Juno
Hi @benachio
Thanks for your answer, Do have any example how to send data by HTTP POST? Its similar to POST with TagoIO?
@Matheus Benachio
Hey @jjuno
Yes, it’s the same format you use when sending data to TagoIO. Here is an example of sending data to TagoCore by using the curl command in the terminal (This command assumes that TagoCore is running in the same computer where you’re running the command).
curl --location --request POST 'http://localhost:8888/data' \
--header 'token: REPLACE_WITH_YOUR_DEVICE_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '[
{
"variable": "temperature",
"value": 75,
"unit": "F"
}
]'
You can also use this command to send data to TagoIO, just switch the http://localhost:8888 address with https://api.tago.io, and switch the token with a TagoIO device’s token.
If your TagoCore is running on a different computer in the same network, just switch the http://localhost:8888 with the local ip of the desired computer (e.g. http://192.168.10.10:8888).
Let me know if you need more details,
Matt.
@Jhonatan Juno
Hi @benachio
Thanks you for your answer.I tried the solution and it worked correctly
(using Windows10 with Postman app).
I have data in my network server to send by POST HTTP, how can I prove it with tagocore?
Finally, Is there a way to use bucket data in a dashboard?
@Matheus Benachio
Hey @jjuno
Awesome! I’m glad it worked.
TagoCore doesn’t offer a native dashboard viewing experience. In future releases you will be able to use plugins inside of TagoCore to see your data in dashboard-like way, but currently there isn’t a way to visualize your data.
For now, if you wish to use your data, you can send a GET request to /data passing the device’s token in the token header. You can learn more about the parameters of the request here: TagoIO API.
And in regards to the network server question, what do you mean by “prove”?
Let me know,
Matt.
Hi everyone,
I´m trying to send data to TagoCore following the instructions given by @Mateus Benachio but but without success. Even using Curl, Postman or TagoIO post api I get the following error:
{“status”:false,“message”:“Error on object parse”,“field_errors”:{“0”:[“Required”]}}
Does anyone have an idea on how to resolve this?
Thanks for the attention.
Hey @wcallegari, make sure you are adding the --header ‘Content-Type: application/json’ to your curl command.
Or, if you are using Postman, make sure you are selecting the Content-Type of the body as JSON. Here is a screenshot of Postman:
In both scenarios (Postman and curl), the data insertion worked for me after using the correct header. Let me know if you still find errors after setting the header!
Just a side note: We have plans to improve these errors in the future, which will make the debugging process much easier.
Hey @Mateus Benachio
Configuring Postman as you informed, I was successful.
The intention is to use Python to send values, and I tested using Python requests API but I didn’t get any result:
import requests
# defining the api-endpoint
API_ENDPOINT = "http://localhost:8888/data"
# data to be sent to api
data = {
"Content-Type": "application/json",
"token": "446a8dfb-74f2-47b5-be0e-d798dee71130",
"variable": "temperature",
"value": 75
}
# sending post request and saving response as response object
r = requests.post(url=API_ENDPOINT, json=data)
print(r.text)
And the answer is:
{"status": false, "message": "Invalid token"}
This is using the same token as in Postman.
I also tried to use the freezer simulator plugin and it also does not accept the same token.
Hey @wcallegari,
Two things:
In the first screenshot, you are sending the token and content-type headers in the body of the request, when they should be sent in the actual header of the request. All you need to do is add the token and content-type in the header tab of postman and remove them from the body tab.
In the second screenshot, you are using the Device Token, when you should be using the Device ID. The Device ID can be found in the “More” tab of the device.
I Hope that fixes the issues that you’re having, and let me know if you have any more questions!