{"id":13834443,"url":"https://github.com/fvicent/thebex","last_synced_at":"2026-01-16T11:45:19.077Z","repository":{"id":177599430,"uuid":"466274447","full_name":"fvicent/thebex","owner":"fvicent","description":"An Elixir client for the ThingsBoard REST API","archived":false,"fork":false,"pushed_at":"2022-03-04T21:31:37.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-20T19:40:00.431Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fvicent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-03-04T21:24:30.000Z","updated_at":"2022-12-07T21:42:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"eaa1207c-3136-4c7f-addd-add83c4bdaee","html_url":"https://github.com/fvicent/thebex","commit_stats":null,"previous_names":["fvicent/thebex"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fvicent/thebex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fvicent%2Fthebex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fvicent%2Fthebex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fvicent%2Fthebex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fvicent%2Fthebex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fvicent","download_url":"https://codeload.github.com/fvicent/thebex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fvicent%2Fthebex/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264528742,"owners_count":23623219,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T14:00:34.693Z","updated_at":"2026-01-16T11:45:19.040Z","avatar_url":"https://github.com/fvicent.png","language":"Elixir","funding_links":[],"categories":["SDKs and REST clients"],"sub_categories":[],"readme":"# Thebex\n\nThebex is an Elixir client for the ThingsBoard REST API.\n\n## Work in progress\n\nThis is a work in progress, though usable, not yet stable. There are no tests. Expect things to change. A few endpoints have been implemented (see below). Feel free to contribute your own endpoints.\n\n## Installation\n\nThebex is not available in Hex yet, so it needs to be installed from this repository.\n\n## Configuration\n\nThe API URL must be configured in your `config.exs`. For example:\n\n```elixir\nconfig :thebex, :thingsboard_api_url, \"https://demo.thingsboard.io/api/\"\n```\n\nIf you just want to test the API via `iex`, you can manually configure the URL by using:\n\n```elixir\niex(1)\u003e Application.put_env(:thebex, :thingsboard_api_url, \"https://demo.thingsboard.io/api/\")\n:ok\n```\n\n## Endpoints\n\nCurrently available endpoints:\n\n  - `Thebex.login(username, password)`\n\n  - `Thebex.customers(token, page, page_size, params \\\\ [])`\n\n  - `Thebex.users(token, page, page_size, params \\\\ [])`\n\n  - `Thebex.customer_title(token, customer_id)`\n\n  - `Thebex.customer_devices(token, customer_id, page, page_size, params \\\\ [])`\n\n  - `Thebex.entity_timeseries(token, entity, params \\\\ [])`\n\n  - `Thebex.entity_latest_timeseries(token, entity, params \\\\ [])`\n\nThe supported `params` are mainly those documented in [Swagger](https://demo.thingsboard.io/swagger-ui/#/). See the [`lib/thebex/client.ex`](https://github.com/fvicent/thebex/blob/main/lib/thebex/client.ex) file for further insight. \n\n## Examples\n\nFirst login to get a token to access the API:\n\n```elixir\niex(1)\u003e {:ok, token} = Thebex.login(\"myaccount@example.com\", \"password123\")\n{:ok, \"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJmcmFuY2lzY...\"}\n```\n\nThen every function from the API will require this token as its first argument.\n\n```elixir\n# Get the latest telemetry from a single device.\niex(2)\u003e device = %Thebex.Schema.EntityId{entity_type: \"DEVICE\", id: \"a4377650...\"}\n# Endpoint reference at\n# https://demo.thingsboard.io/swagger-ui/#/telemetry-controller/getLatestTimeseriesUsingGET\niex(3)\u003e Thebex.entity_latest_timeseries(token, device)\n%{\n  \"humidity\" =\u003e %Thebex.Schema.DataPoint{ts: 1642986254092, value: 90},\n  \"temperature\" =\u003e %Thebex.Schema.DataPoint{ts: 1642986254092, value: 28}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffvicent%2Fthebex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffvicent%2Fthebex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffvicent%2Fthebex/lists"}