Messagebird General

From 탱이의 잡동사니
Revision as of 08:58, 5 October 2018 by Pchero (talk | contribs) (→‎General)
Jump to navigation Jump to search

Overview

Messagebird develop document 내용 정리

General

Introduction

The MessageBird APIs connect your website or application to operators around the world. With our APIs you can integrate SMS, Chat & Voice.

REST

The MessageBird API uses HTTP verbs and a RESTful endpoint structure. An access key is used as the API Authoriiztion framework. Request and response payloads are formatted as JSON(although we provide a GET alternative for requests), using UTF-8 encoding and URL encoded values.

GET STARTED

To use this API you an account on MessageBird.com and an access key, which can be created in your account.

MessageBird provides the creation of the keys to discover and test the API at your own convenience. The difference between a live key and a test key is that a live key actually sends a message, while a test key does not. However, when you send a message using a test key, you will get a fake created object back.

API ENDPOINT

https://rest.messagebird.com/

IP-ADDRESS

Our API platform is offered from a global distributed infrastructure. Hence you will not be able to whitelist the IP-addresses of our platform. Requests from our platform (for delivery reports and inbound messages) originate from various IP-addresses.

Authentication

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

Don't have an access key? Get an access key in the API menu in your account. There you can create test and live keys.

When your application can't send an Authorization header, you can use the GET parameter access_key to provide your access key.

We do not provide incoming request whitelisting on our platform for our REST API. All requests are forced SSL with an access key.

  • PARAMETER
Authorization : When calling our API, send your access key with the authentication type set as AccessKey(Example: Authorization: AccessKey {accessKey}). Required.
Accept : Set to application/json. Required.
  • CURL EXAMPLE
$ curl https://rest.messagebird.com/balance -H 'Authorization: AccessKey test_gshuPaZoeEG6ovbc8M79w0QyM'

{"payment":"prepaid","type":"credits","amount":10.1}
  • EXAMPLE(GET)
$ curl https://rest.messagebird.com/balance\?access_key\=test_gshuPaZoeEG6ovbc8M79w0QyM

{"payment":"prepaid","type":"credits","amount":10.1}

If possible, please use the Authorization header.

Requests

POST and PUT requests to the API should contain a JSON-formatted payload in the request body. Alternatively, resource attributes can be sent through GET parameters(See alternatives).

  • JSON REQUEST PAYLOAD EXAMPLE
{
    "recipients":31612345678,
    "originator":"MessageBird",
    "body":"The message to be sent"
}