Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can you add relation api ? #4

Open
xcloudlive opened this issue Apr 17, 2020 · 1 comment
Open

can you add relation api ? #4

xcloudlive opened this issue Apr 17, 2020 · 1 comment

Comments

@xcloudlive
Copy link

it is a great job for accessing thingsboard, i really appreciated you. Now i need init many asset and device by api,but i found there is no relation in your code. can you add relation api ? Thanks!

@fjpa121197
Copy link

Hey, hope it is not late, but relation can be added like this:

relations = {"from": {"id": from_entity_id,
"entityType": from_entity_type},
"type": "Contains", "to": {"entityType": to_entity_type,
"id": to_entity_id}}

relations_r = requests.post('http://127.0.0.1:8080/api/relation', json=relations, headers=headers)

headers should be the usual part as is in the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants