Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gravityblast/messenger
Facebook messenger API client for Elixir
https://github.com/gravityblast/messenger
Last synced: about 9 hours ago
JSON representation
Facebook messenger API client for Elixir
- Host: GitHub
- URL: https://github.com/gravityblast/messenger
- Owner: gravityblast
- License: mit
- Created: 2016-04-29T16:43:18.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-04-30T23:42:07.000Z (over 8 years ago)
- Last Synced: 2023-04-11T01:05:58.756Z (over 1 year ago)
- Language: Elixir
- Size: 9.77 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Messenger
Facebook messenger API client for Elixir
## Installation
1. Add messenger to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:messenger, "~> 0.0.1"}]
end
```2. Ensure messenger is started before your application:
```elixir
def application do
[applications: [:messenger]]
end
```## Usage
```elixir
alias Messenger.Recipient
alias Messenger.Message
alias Messenger.Requestpage_access_token = System.get_env "PAGE_ACCESS_TOKEN"
my_user_id = System.get_env "MY_USER_ID"recipient = Recipient.new
|> Recipient.put_id(my_user_id)message = TextMessage.new
|> TextMessage.put_text("Hello world")resp = Request.new
|> Request.put_recipient(recipient)
|> Request.put_message(message)
|> Request.send(page_access_token)
```