README.md

# Direxion

A Microsoft Directline Client in Elixir

## Installation

If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `direxion` to your list of dependencies in `mix.exs`:

```elixir
def deps do
  [
    {:direxion, "~> 0.1.0"}
  ]
end
```

Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at [https://hexdocs.pm/direxion](https://hexdocs.pm/direxion).

## Usage

```elixir
defmodule DirectlineTest do
  import Direxion
  ...
  activity_response = message(DIRECTLINE_TOKEN_HERE, ACTIVITY_TO_SEND)
```

The `message` function is a composite of three underneath functions each of which does the following
- Starts a conversation with Directline
- Sends it an activity
- Receives the reponse activity

## Composite Functions 

### start_conversation

Parameters:
* token - The Directline Tokenå

Starts a conversation with directline  

```elixir
start_conversation(DIRECTLINE_TOKEN_HERE)
```

### send_activity

Parameters:
  * token - The Directline Token
  * conversation_id - The Conversation ID
  * activity - The activity payload

 Sends an activity to a given conversation

```elixir
send_activity(DIRECTLINE_TOKEN_HERE, CONVERSATION_ID, ACTITVITY_TO_SEND)
```

### receive_activities

Parameters:
* token - The Directline Token
* conversation_id - The Conversation ID
 
Receive the activities from a conversation.

```elixir
receive_activities(DIRECTLINE_TOKEN_HERE, CONVERSATION_ID)
```