Messagebird APIs VoiceCalling

From 탱이의 잡동사니
Revision as of 08:44, 7 October 2018 by Pchero (talk | contribs)
Jump to navigation Jump to search

Overview

Messagebird API VoiceCalling 내용 정리.

Basic

Voice Calling offers VoIP features for handing phone calls from/to voice capable number purchased via MessageBird.

The MessageBird API uses HTTP verbs and a RESTful endpoint structure. An access key is used as the API Authorization framework. Request and response payloads are formatted as JSON using UTF-8 encoding and URL encoded values, unless specified otherwise.

API Endpoint

https://voice.messagebird.com/

Endpoint Summary

  • GET /call-flows/
  • GET /call-flows/{id}
  • POST /call-flows/
  • PUT /call-flows/{id}
  • DELETE /call-flows/{id}
  • POST /calls/
  • GET /calls/
  • GET /calls/{callID}
  • GET /calls/{callID}/legs
  • GET /calls/{callID}/legs/{legID}
  • GET /calls/{callID}/legs/{legID}/recordings
  • GET /calls/{callID}/legs/{legID}/recordings/{recordingID}
  • GET /calls/{callID}/legs/{legID}/recordings/{recordingID}.wav
  • GET /calls/{callID}/legs/{legID}/recordings/{recordingID}/transcriptions
  • POST /calls/{callID}/legs/{legID}/recordings/{recordingID}/transcriptions
  • GET /calls/{callID}/legs/{legID}/recordings/{recordingID}/transcriptions/{transcriptionID}
  • GET /calls/{callID}/legs/{legID}/recordings/{recordingID}/transcriptions/{transcriptionID}.txt

Authentication

With each API call, you will need to set request headers, including access key to authenticate yourself.

Header

Header : Description : Required
Authorization : Must be in the form of AccessKey {accessKey} : Yes

Versioning

The Voice Calling API uses dated versioning. When backward-incompatible changes are made, a new version is released. By default, all calls to the API use the latest version, currently: 20170314. A specific API version can be set per request by sending a X-MessageBird-Version header. Future releases will be announced on this page.

Header

Header : Description : Required
X-MessageBird-Version : Must be in the form of YYYYMMDD. : No

Requests

POST and PUT requests to the API should contain a JSON-formatted payload in the request body.

  • JSON REQUEST PAYLOAD EXAMPLE
{
  "title": "Example Call Flow",
  "steps": [
    {
      "id": "foo",
      "action": "transfer",
      "options": {
        "destination": "31612345678"
      }
    },
    {
      "id": "bar",
      "action": "hangup"
    }
  ]
}