{"id":19640170,"url":"https://github.com/gearplug/bird_python","last_synced_at":"2025-10-30T07:15:19.519Z","repository":{"id":222493776,"uuid":"757284818","full_name":"GearPlug/bird_python","owner":"GearPlug","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-21T13:43:20.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-01-09T18:55:57.712Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/GearPlug.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-14T07:10:33.000Z","updated_at":"2024-02-21T13:42:30.000Z","dependencies_parsed_at":"2024-02-21T14:39:58.073Z","dependency_job_id":null,"html_url":"https://github.com/GearPlug/bird_python","commit_stats":null,"previous_names":["gearplug/bird-python"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GearPlug%2Fbird_python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GearPlug%2Fbird_python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GearPlug%2Fbird_python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GearPlug%2Fbird_python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GearPlug","download_url":"https://codeload.github.com/GearPlug/bird_python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240947651,"owners_count":19883030,"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-11-11T14:04:56.380Z","updated_at":"2025-10-30T07:15:19.423Z","avatar_url":"https://github.com/GearPlug.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Bird's REST API for Python\n=================================\nThis repository contains the open source Python client for New MessageBird's REST API. Documentation can be found at: https://docs.bird.com/api/.\n\n\nRequirements\n------------\n- [Sign up](https://www.messagebird.com/en/signup) for a free MessageBird account\n- Create a new access key in the developers sections\n- An application written in Python (tested with Python 2.7 and Python 3.4)\n\nInstallation\n------------\nThe easiest way to install the bird_python package is either via pip:\n\n```\n$ pip install bird_python\n```\n\nExamples\n--------\nWe have put some self-explanatory examples in the [examples](https://github.com/messagebird/python-rest-api/tree/master/examples) directory, but here is a quick example on how to get started. Assuming the installation was successful, you can import the messagebird package like this:\n\n```python\nimport bird_python as messagebird\n```\n\nThen, create an instance of **messagebird.Client**:\n\n```python\nclient = messagebird.Client('YOUR_ACCESS_KEY', 'YOUR_ORGANIZATION_ID')\n```\n\nNow you can query the API for information or send a request. For example, if we want to send a message through any channel like whatsapp, you'd do something like this:\n\n```python\ntry:\n  # Get and set any workspace for sent request to the channels related.\n  client.workspaces = client.workspace_list()['results'][0]['id']\n  # Get and set any channel id for sender request, for example: Whatsapp, Messenger, SMS\n  channels_id = client.channel_list()['results'][0]['id']\n  \n  # Build the body message like this format\n  body = {\n        \"receiver\": {\n            \"contacts\": [\n                {\n                    \"identifierValue\": \"+15598585\"\n                }\n            ]\n        },\n        \"body\": {\n          \"type\": \"text\",\n          \"text\": {\n            \"text\": \"Single text message\"\n          }\n        }\n    }\n  \n  response = client.send_message(channels_id=channels_id, body=body)\n\n  # Print the object information.\n  print('response:\\n')\n  print(response)\n\nexcept messagebird.client.ErrorException as e:\n  print('Error:\\n')\n\n  for error in e.errors:\n    print('  code        : %d' % error.code)\n    print('  description : %s' % error.description)\n    print('  parameter   : %s\\n' % error.parameter)\n\n```\n\n\nActions\n-------\n\n\n1. **Get Contact**\n```python\ncontact = client.contact(uuid='YOUR_CONTACT_ID')\n# Retrieve the information of a specific contact.\n```\n\n2. **Create Contact**\n```python\nbody = {\n        \"displayName\": \"Jhon Doe\",\n        \"identifiers\": [\n                {\n                    \"key\": \"phone\",\n                    \"value\": \"+15551234\"\n                }\n            ]\n        }\ncontact = client.contact_create(body=body)\n# Allows create a contact.\n```\n\n3. **Get Contact List**\n```python\ncontact = client.contact_list()\n# Extract all contacts created in a workspace.\n```\n\n4. **Get Workspace List**\n```python\ncontact = client.workspace_list()\n# Gets a list of workspaces created in an organization's account.\n```\n\n5. **Get Workspace By ID**\n```python\ncontact = client.workspace_list_by_id(uuid='YOUR_WORKSPACE_ID')\n# Gets a list of workspaces created in an organization's account.\n```\n\n6. **Get Project List**\n```python\ncontact = client.project_list()\n# Gets a list of projects created in an workspace.\n# In this API you get what were previously known as templates,\n# only now they can be compatible with multiple channels.\n```\n\n7. **Get Project By ID**\n```python\ncontact = client.project_list_by_id(uuid='YOUR_PROJECT_ID')\n# Gets one project created in an workspace by id.\n```\n\n8. **Get Channel List**\n```python\ncontact = client.channel_list()\n# Gets a list of channels created in an workspace.\n```\n\n9. **Get Channel By ID**\n```python\ncontact = client.channel_list_by_id(uuid='YOUR_CHANNEL_ID')\n# Gets one channel created in an workspace by id.\n```\n\n10. **Get Connector List**\n```python\ncontact = client.connector_list()\n# Gets a list of connectors created in an workspace.\n# A connector can be Whatsapp, Messenger, SMS\n```\n\n11. **Get Connector By ID**\n```python\ncontact = client.connector_list_by_id(uuid='YOUR_CONNECTOR_ID')\n# Gets one connector created in an workspace by id.\n```\n\n12. **Send Message**\n```python\nbody = {\n        \"receiver\": {\n            \"contacts\": [\n                {\n                    \"identifierValue\": \"+15551234\"\n                }\n            ]\n        },\n        \"body\": {\n          \"type\": \"text\",\n          \"text\": {\n            \"text\": \"Single text message\"\n          }\n        }\n    }\ncontact = client.send_message(channels_id='YOUR_CHANNEL_ID', body=body)\n# Allows you to send a message through a channel.\n# :param channels_id: ID of the channel through which you want to send the message\n# :param body: Body of the message in json, which contains all the information necessary to send the message\n```\n\n13. **Get Webhook Event List**\n```python\ncontact = client.webhook_event_list()\n# Gets a list of webhooks available in an workspace.\n```\n\n14. **Create Webhook**\n```python\ncontact = client.webhook_create(body='body')\n# Allows create a webhook based in a event of available webhook list.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgearplug%2Fbird_python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgearplug%2Fbird_python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgearplug%2Fbird_python/lists"}