using the gsma oneapi gateway

27
Confidential 1 GSMA OneAPI Gateway It's a Cross Carrier play Here's where APIs get really exciting!

Upload: gsma-oneapi-gateway

Post on 26-Jan-2015

131 views

Category:

Technology


5 download

DESCRIPTION

A Easy Step by Step Guide on How to get started using the GSMA OneAPI Gateway

TRANSCRIPT

Page 1: Using the GSMA OneAPI Gateway

Confidential 1

GSMA OneAPI Gateway

It's a Cross Carrier play

Here's where APIs get really exciting!

Page 2: Using the GSMA OneAPI Gateway

Confidential 2

OneAPI — Registration

1. Register at:https://oneapi-gw.gsma.com

2. Confirm email3. Log in

Provides access to dashboard and developer documentation

Page 3: Using the GSMA OneAPI Gateway

Confidential 3

Creating an Application

Page 4: Using the GSMA OneAPI Gateway

Confidential 4

Manage Application

You can find this page from the Dashboard:

1. Go to Dashboard2. Click on the company

name link below Developer Profiles (bottom of page)

3. Click on the Manage Application button next to your application name.

Page 5: Using the GSMA OneAPI Gateway

Confidential 5

Application Specific Info

Note the two application profile buttons: “Endpoints” — Important application settings necessary

for using the APIs “Manage Whitelist” — Phone numbers for testing with

APIs

Page 6: Using the GSMA OneAPI Gateway

Confidential 6

Necessary Information

Application Profile — Endpoints– Application User Name & Application Password– The URI prefixes (excluding the “.*” suffix, shown, if

any) for each API-type PDF documents describing API sets’ usage

– “Common Information Guide” some error codes– “Sandbox Data service” prereq for Payments APIs

described in “Payment Developer Guide”– “Privacy Developer Guide” prereq for Location APIs

described in “Terminal Location Developer Guide”

Page 7: Using the GSMA OneAPI Gateway

Confidential 7

API Protocol

HTTP / REST (mostly) HTTP Basic Access Authentication Form-data or JSON Input XML or JSON output Some APIs Accept Callback URIs

Page 8: Using the GSMA OneAPI Gateway

Confidential 8

Tools

curl — Unix, Linux, OSX, cygwin/Win RESTClient — Firefox plug-in Chrome debug console — Chrome Browser (GET method testing) Coding

Page 9: Using the GSMA OneAPI Gateway

Confidential 9

RESTClient

Page 10: Using the GSMA OneAPI Gateway

Confidential 10

APIs Supported

Sending SMS from short code to phone Receiving SMS (to short code) Location (latitude/longitude) Payment — Charge to phone bill

Page 11: Using the GSMA OneAPI Gateway

Confidential 11

Send SMS to Phone

1. Add test phone number to Whitelist

2. Create request JSON in a file

3. Call HTTP

4. Receive Transaction ID

Use Transaction ID to check delivery status

Page 12: Using the GSMA OneAPI Gateway

Confidential 12

SMS Send JSON Example

{ "outboundSMSMessageRequest": { "address": ["tel:+16045551212"], "clientCorrelator": "10002", "outboundSMSTextMessage":

{ "message": "Test SMS from 7511" }, "senderAddress": "tel:7511", "senderName": "Super Send" }}

Page 13: Using the GSMA OneAPI Gateway

Confidential 13

SMS Send Response

https://oneapi-gw.gsma.com/smssend/2_0/smsmessaging/outbound/tel%3A7511/requests{ "resourceReference" : { "resourceURL" :

"https://oneapi-gw.gsma.com:443 /SendSmsService/OneAPI_REST_v2_0 /routing/2_0/smsmessaging/outbound /tel:7511/requests/222405168"

}}

Page 14: Using the GSMA OneAPI Gateway

Confidential 14

Checking SMS Status

https://oneapi-gw.gsma.com/smssend/2_0/smsmessaging/outbound/tel:7511/requests/222405168/deliveryInfos{ "deliveryInfoList" : { "resourceURL" :

"https://oneapi-gw.gsma.com:443/SendSmsService/OneAPI_REST_v2_0/routing/2_0/smsmessaging/outbound/tel:7511/requests/222405168/deliveryInfos",

"deliveryInfo" : [ { "address" : "tel:+16045551212", "deliveryStatus" : "DeliveredToNetwork" } ] …

Page 15: Using the GSMA OneAPI Gateway

Confidential 15

Location Query

1. Whitelist phone number

2. Get permission to retrieve position (once only, per app, privacy API)

3. User authorizes

4. Retrieve user’s location

Page 16: Using the GSMA OneAPI Gateway

Confidential 16

Location Response

https://oneapi-gw.gsma.com/location/2_0/location/queries/location?address=tel%3A%2B16045551212&requestedAccuracy=5000{ "terminalLocationList" : { "terminalLocation" : [ { "address" : "tel:+16045551212", "locationRetrievalStatus" : "Retrieved", "currentLocation" : { "latitude" : 49.248688, "longitude" : -123.19475, "altitude" : 0.0, "accuracy" : 769, "timestamp" : "2012-05-30T17:41:37.000-04:00" } } ] …

Page 17: Using the GSMA OneAPI Gateway

Confidential 17

Location API Example

1. Add phone number to Whitelist

2. Ask permission to retrieve location

POST https://oneapi-gw.gsma.com/privacy HTTP/1.1Content-Type: application/x-www-form-urlencodedaddress=tel%3A%2B16045551212&callbackUrl=http%3A%2F%2Fwww.example.com

Page 18: Using the GSMA OneAPI Gateway

Confidential 18

Location API Example

3. User responds to text with “ALLOW”4. Check status (or use callback)https://oneapi-gw.gsma.com/privacy?address=tel%3A%2B16045551212<?xml version="1.0"

encoding="UTF-8"standalone="yes"?><PrivacyResponse status="ALLOWED"/>

All future location requests are enabled for the app for that user.

Page 19: Using the GSMA OneAPI Gateway

Confidential 19

Location API Example

5. Retrieve locationhttps://oneapi-gw.gsma.com/location/2_0/location/queries/location?address=tel%3A%2B16045551212&requestedAccuracy=5000 { "terminalLocationList" : { "terminalLocation" : [ { "address" : "tel:+16045551212", "locationRetrievalStatus" : "Retrieved", "currentLocation" : { "latitude" : 49.248688, "longitude" : -123.19475, "altitude" : 0.0, "accuracy" : 769, "timestamp" : "2012-05-30T17:41:37.000-04:00" } } ] }}

Page 20: Using the GSMA OneAPI Gateway

Confidential 20

Payment API

1. Create Payments Sandbox Group (if not already created)

2. Add “subscribers” to the group, by phone number

3. Call Payment API to “charge” money

4. Call Payment API to detect status

Page 21: Using the GSMA OneAPI Gateway

Confidential 21

Payment Example

1. Create Payments Sandbox Grouphttps://oneapi-gw.gsma.com/sandboxdataservice/Payment_Sandbox

2. Add phone numbers to grouphttps://oneapi-gw.gsma.com/sandboxdataservice/Payment_Sandbox/tel%3A%2B16045551212

Page 22: Using the GSMA OneAPI Gateway

Confidential 22

Payment Example

1. Create payment request JSON{ "amountTransaction": { "clientCorrelator": "100003", "endUserId": "tel:+16045551212", "paymentAmount": { "chargingInformation": { "amount": "10.01", "currency": "CAD", "description": [”Our product"] }, "chargingMetaData" : { "onBehalfOf" : "Viafo Inc", "purchaseCategoryCode" : "Game", "taxAmount" : "0" } }, "referenceCode": "REF-NJD-12345a", "transactionOperationStatus": "CHARGED" }}

Page 23: Using the GSMA OneAPI Gateway

Confidential 23

Payment Example

2. Call Payment function API

https://oneapi-gw.gsma.com/sandboxpayment/2_1/payment/tel%3A%2B16045551212/transactions/amount

Page 24: Using the GSMA OneAPI Gateway

Confidential 24

Payment Example

3. Payment call’s response{ "amountTransaction": { "clientCorrelator": "1234569", "endUserId": "tel:+13107486358", "paymentAmount": { "chargingInformation": { "amount": 5.0, "currency": "CAD", "description": [ "Alien Invaders Game" ] }, "chargingMetaData": { "onBehalfOf": "Example Games Inc", "purchaseCategoryCode": "Game", "taxAmount": 0 }, "totalAmountCharged": 5.0 }, "referenceCode": "REF-005", "resourceURL":

"https://oneapi-gw.gsma.com:443/PaymentService/OneAPI_REST_v2_1/sandbox/2_1/payment/tel%253A%252B13107486358/transactions/amount/REF-005-175",

"serverReferenceCode": "REF-005-175", "transactionOperationStatus": "CHARGED" }}

Page 25: Using the GSMA OneAPI Gateway

Confidential 25

Payment Example

4. Check payment request statushttps://oneapi-gw.gsma.com/payment/2_1/payment/tel%3A%2B16045551212/transactions/amount/REF-005-175

Page 26: Using the GSMA OneAPI Gateway

Confidential 26

Speakers & Your Developer Evangelists

Caroline Lewko Bill Lee David O’Neill

Page 27: Using the GSMA OneAPI Gateway

Confidential 27

http://bit.ly/oneapi-usage-notes

http://www.slideshare.net/oneapilive/using-the-gsma-oneapi-gateway