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

Support sending to the team inbox. #8

Open
rteabeault opened this issue May 12, 2014 · 4 comments
Open

Support sending to the team inbox. #8

rteabeault opened this issue May 12, 2014 · 4 comments

Comments

@rteabeault
Copy link

Create a new method that will post to the team inbox

inbox: (flowId, message, tags, callback) ->
    data =
      flow: flowId
      event: 'mail'
      source: message.source
      from_address: message.from_address
      subject: message.subject
      content: message.content
      tags: tags || []
   @send "/messages", data, callback
@Mumakil
Copy link
Contributor

Mumakil commented Sep 26, 2014

Currently the api does not allow posting to inbox using user authorization, it only works with flow api token. The way to implement this would be to just create a Flow object that works a bit like Session but allows just posting to a flow inbox using flow api token. That said, we're about to release a new version of our message api, so I'd like to postpone this still a bit (I know this was opened in may, sorry about the dealy in reacting!)

@kimmobrunfeldt
Copy link

Any updates to this?

@Mumakil
Copy link
Contributor

Mumakil commented Jun 22, 2015

Yeah. We have the new api details available here. Posting is as simple as providing the message and thread payload along with the new source token. I'm not sure if creating a wrapper is any useful, since it's going to require almost the exact same parameters as just using request. The message and thread data needs to be composed manually anyway, so the difference between

data = ... // compose message payload
data["flow_token"] = flowToken
request('/messages', {json: data}, callback)

and

flow = new Flow(flowToken)
data = ... // compose message payload
flow.inbox(data, callback)

is pretty minimal.

@fitch
Copy link

fitch commented Aug 20, 2015

Do you have a complete example on how to post something to the team inbox?

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

4 participants