Services¶
Instance¶
Parameters:
Optional token: strToken is a optional parameter (Analysis Token).Optional region: str “usa-1” or “env”Region is a optional parameter
from tagoio_sdk import Services
services = Services()
Attachment¶
Send Attachment
Parameters:
archive: ArchiveFileArchive JSON Object
from tagoio_sdk import Services
services = Services()
services.Attachment.upload(
{
"name": "Test",
"content": "base64",
"type": "Test",
}
)
ConsoleService¶
Log message in analysis console
Parameters:
message: strLog messageOptional time: datetimeDate of message
from tagoio_sdk import Services
services = Services()
services.console.log(
{
"message": "Test",
}
)
Email¶
Send Email
Parameters:
Email objects
from tagoio_sdk import Services
services = Services()
services.email.send(
{
"to": "myclien@tago.io",
"subject": "Test Subject",
}
)
MQTT¶
Publish to a MQTT Device
Parameters:
mqtt: MQTTDataMQTT object, contains topic, bucket, message and options(retain and qos)
from tagoio_sdk import Services
services = Services()
services.MQTT.publish(
{
"bucket": "my_device_id",
"message": "Test",
"topic": "teste/TEMPERATURE",
"options": {"qos": 0, "retain": False},
}
)
Notification¶
Send Notification
You can add ref_id from a bucket or dashboard, if it is valid it will show up a button Go To Dashboard Any account with share of the dashboard/bucket will receive too.
Parameters:
notification: NotificationCreateNotification Object
from tagoio_sdk import Services
services = Services()
services.Notification.send(
{
title: "Example",
message: "Message Test",
}
)
PDF¶
Generate a PDF from html, url or base64
Parameters:
params: PDFParamsParameters used to generate the pdf
from tagoio_sdk import Services
services = Services()
services.PDF.generate(
{
base64: "base64"
}
)
SMS¶
Send SMS to phone number
Parameters:
sms: SMSDataData that sms will be send, number and message
from tagoio_sdk import Services
services = Services()
services.sms.send(
{
"to": "434434434434",
"message": "Test",
}
)