[MBF2] Webinar API Orange Partner #2

Preview:

Citation preview

Orange APIs#MBF2 Challenge

April 16, 2015

Cloud

API

M2MAPI

BeaconsAPI

Identity

API

Datavenue

APIs

Self-service

Go-to-market

AliasNumbers

API

Orange APIs

Cloud

API

M2MAPI

BeaconsAPI

Identity

API

Datavenue

APIs

Self-service

Go-to-market

AliasNumbers

API

Orange APIs

At the gym…

> >

…we have a good example of efficient B2B2C relationships.

MarcoGymTech CTO

> >

Marco develops health and fitness solutions for gym clubs.

> >

Jim runs a gym club and relies on Marco to boost his business.

JimGym manager

> >

Peter is one of his customers.

Peter Gym customer

> >

Let’s focus on Jim, who wants to track various activities in his club…

Jim

> >

and send relevant information to the right people, at the right moment.

Jim

That’s where the Orange Beacons can help. They only do one thing…

they trigger notifications to GymTech app users, and they do it right.

Jim can unpack and install his Orange Beacons himself.

With the Orange Beacon app…

…Jim can scan the beacon’s QR code…

…check and edit the default configuration…

…that was defined and provisioned by Marco, his GymTech integrator.

For instance, Jim can fine-tune the detection range…

…and even customize the greetings and farewell messages, at his convenience.

Jim can later check the essential analytics, at his fingertips.

PeterGym customer

So what’s in it for Peter?

GymTechmobile app

Peter already installed the GymTech app on his smartphone.

PeterGym customer

He can be notified when he enters the club, even if his phone is asleep.

Notifications can be visible for information - or hidden for tracking.

Peter can then be treated like a VIP at all time.

GymTech

Welcome back to GymTechYour digital coach at the Gym.

OK

Do you want to give it a try?

Cancel

BRAND NEW FOR YOU!

And of course, he keeps total control over the notification mechanism.

MarcoGymTech CTO

Let’s focus on Marco now.

Orange Beacon

Beacons

mobile appsSDKs

GymTechapp

Orange Beaconplatform

Peter

Marco benefits from complete Orange SDKs to develop his GymTech apps.

Orange Beacon

Beacons

Orange Beaconplatform

Partner’sportal

management & analyticsAPIs

Partner’s platforms

Partner(GymTech)

Peter

Settings and management can be done via APIs and the partner’s portal.

Orange Beacon

Beacons

Orange Beaconplatform

Partner’s platforms

Partner(GymTech)

Orangeportal

Gym Manager(Jim)

Orangeapp

SettingsPeter

Jim manages his own beacons with his merchant’s portal and Orange app.

Orange Beacon SDK

With the iOS SDK, it takes a few lines to delegate everything to the Orange library.

Orange Beacon SDK

Same with Android SDK.

Marco simply configures all the beacons on his partner’s portal…

…and assigns them to the pool of relevant gym clubs he monitors.

Marco also gets consolidated analytics.

Cloud

API

M2MAPI

BeaconsAPI

Identity

API

Datavenue

APIs

Self-service

Go-to-market

AliasNumbers

API

Orange APIs

Now, let’s focus on Jim: he wants to delight his customers and better manage his equipments.

> >

JimGym manager

Jim cannot manually manage all the machines, but he needs to make informed decisions re: security, maintenance, renewals, etc.

His equipments are of 2 kinds:most machines are old but the newest can be upgraded.

Marco has a solution: Make the gym all connected!

MarcoGymTech CTO

>

Marco wants to connect both old and new machines.

He makes new hardware kits with sensors to plug on old machines…

etc.

…and he just develops software modules for most recent ones.

< / >

C, Java, etc.

Marco,GymTech

CTO

Making objects is great, but how to connect them? How to collect & store data?

?

< / >

This is where Orange can help: Datavenue platform is the solution.

Orange Datavenueplatform Marco,

GymTech

CTO

< / >

Orange Datavenueplatform

Store

Manage

Secure

Datavenue platform will collect, store, manage & secure data for Marco.

Orange Datavenueplatform

Marco,GymTech CTODatavenue portal

Store

Manage

Secure

First, Marco defines on Datavenue Portal the data models and streams to collect.

Orange Datavenue

APIs

Marco,GymTech CTODatavenue portal

Store

Manage

Secure

GymTech’s H/W + S/W

Collect APIPeter,the end-user

< / >

He quickly integrates the APIs in his code, with simple SDKs.

Orange Datavenue

APIs

Marco,GymTech CTODatavenue portal

Aggregation API

Other data

Store

Manage

Secure

GymTech’s H/W + S/W

Collect APIPeter,the end-user

< / >

He can also aggregate data from other platforms: Parrot, Netatmo, Withings, etc.

Orange Datavenue

APIs

Marco,GymTech CTODatavenue portal

Access API

GymTech’s platforms

apps

Jim incontrol,as Gymmanager

Aggregation API

Other data

Store

Manage

Secure

GymTech’s H/W + S/W

Collect APIPeter,the end-user

< / >

Then he can access, manage and visualize data for his apps & services.

Orange Datavenue

APIs

Marco,GymTech CTODatavenue portal

Access API

GymTech’s platforms

apps

Jim incontrol,as Gymmanager

Aggregation API

Other data

Store

Manage

Secure

other apps

other platforms

FutureSharing APIs

- Jim’s data, with his consent

- Anonymized data

3rd Party

GymTech’s H/W + S/W

Collect APIPeter,the end-user

< / >

Eventually, 3rd parties can access data with explicit consent from Jim…

Orange Datavenue

APIs

Marco,GymTech CTODatavenue portal

Access API

GymTech’s platforms

apps

Jim incontrol,as Gymmanager

Aggregation API

Other data

Store

Manage

Secure

other apps

other platforms

FutureSharing APIs

- Jim’s data, with his consent

- Anonymized data

3rd Party

GymTech’s H/W + S/W

Collect APIPeter,the end-user

< / >

…or access sets of aggregated & anonymized data.

Orange Datavenueplatform

Store

Manage

Secure

To sum-up, with Datavenue…

Orange Datavenueplatform

Store

Manage

Secure

Marco can easily define, collect, aggregate, access & share data, securely.

Define

Orange Datavenueplatform

Store

Manage

Secure

Collect

Marco can easily define, collect, aggregate, access & share data, securely.

Define

Orange Datavenueplatform

Aggregate

Store

Manage

Secure

Collect

Marco can easily define, collect, aggregate, access & share data, securely.

Define

Orange Datavenueplatform

Aggregate

Store

Manage

Secure

Collect

Marco can easily define, collect, aggregate, access & share data, securely.

Define

Access

Orange Datavenueplatform

ShareAggregate

Store

Manage

Secure

Collect

Marco can easily define, collect, aggregate, access & share data, securely.

Define

Access

The Datavenue portal lets Marco define & manage his prototypes, data sources…

Marco

…and even engine rules to trigger actions when thresholds are met.

Marco

Marco really enjoys the clarity of the portal…

Marco

…and also the direct sample codes, ready to paste in his code.

Marco

List the datasources

Datavenue is highly secure, with a strict & clear policy for keys.

Marco

Cloud

API

M2MAPI

BeaconsAPI

Identity

API

Datavenue

APIs

Self-service

Go-to-market

AliasNumbers

API

Orange APIs

Privacy is key for Marco who developed the GymTech app.

Marco

GymTech app

?

He needs to identify users like Peter and get their consent…

Peter

?

…to access their resources like their personal clouds.

IdentificationAuthorization

?

That’s where Orange Identity APIs can help…

OAuth V2

…with OAuth V2 for easy app authentication…

OAuth V2

Open IDConnect

…Open ID Connect (OIDC) that adds secure and standard identification…

OAuth V2

Open IDConnect

Mobile Connect

…and Mobile Connect, the ultimate security, via SIMs, for mobile users.

Cloud

API

M2MAPI

BeaconsAPI

Identity

API

Datavenue

APIs

Self-service

Go-to-market

AliasNumbers

API

Orange APIs

Peter Gym customer

Let’s focus on Peter, the Gym customer.

Peter uses his smartwatch to take a snapshot of his best performance ever.

GymTech congrats! best time ever

15+ km/h

Save this momentto your Orange Cloud

This handy remote control could even let him save this moment to his cloud.

It’s Marco who developed the GymTech app and smartwatch extensions.

Peter GymTech

app user

MarcoGymTech app

developer

But how did Marco manage to interface Peter’s personal cloud directly?

Peter GymTech

app user

MarcoGymTech app

developer

?

Peter’s personal cloud

at Orange

Orange Cloud APIs

That’s where Orange helped.

Let’s focus on the user experience first, at the Gym.

Peter

end user

Peter’s personal

cloud

GymTechapp

The first time Peter launches the app…

Activation code We have sent an SMS with your activation code.Please enter this code below

Code:

GymTech

…he’s invited to select the personal cloud he wants GymTech to use.

Activation code We have sent an SMS with your activation code.Please enter this code below

Code:

GymTech

Your personal cloud

Welcome to GymTechYour digital coach at the Gym.

As your privacy is our top priority,we will only store pictures and logsin your own private space.

For Orange Cloud, Peter signs-in with his Orange (mobile or box) credentials.

Activation code We have sent an SMS with your activation code.Please enter this code below

Code:

peter.2020@orange.fr

●●●●●●●

Peter can then authorize the GymTech app to access his personal cloud.

Activation code We have sent an SMS with your activation code.Please enter this code below

Code:

peter.2020@orange.fr

**********peter.2020@orange.fr

And… voilà!

Activation code We have sent an SMS with your activation code.Please enter this code below

Code:

peter.2020@orange.fr

**********

GymTech

Orange Cloud storage: 63% left

Thank you

GymTech can now access yourOrange Cloud, in the following root directory:mes dossiers partenaires/GymTech/

OK

The GymTech app can upload, browse and manage files in Peter’s cloud.

Activation code We have sent an SMS with your activation code.Please enter this code below

Code:

peter.2020@orange.fr

**********

GymTech

+15+ km/h

Away from the Gym…

…Peter can manage his files from all his devices.

For intance, he can sign-in from his tablet…

peter.2020@orange.fr

…and retrieve latest GymTech files from the Orange partners’ folder.

peter.2020@orange.fr

15+ km/h

At home…

…Peter can sign-in from any browser…

peter.2020@orange.fr

…and browse the specific GymTech folder.

Peter

ForeverPocket ScannerGymTech

Peter gets a summary of all partners’ apps accessing his cloud.

GymTech

Peter

GymTech

At any time, Peter can revoke access to his cloud.

GymTech

Peter

GymTech

Now let’s come back to Marco, the GymTech developer.

MarcoGymTech CTO

Marco just needs his GymTech app to access Peter’s cloud.

Peter GymTech

app user

MarcoGymTech app

developer

Peter’s personal cloud

at Orange

It’s so easy with the Orange Cloud APIs.

Orange Cloud APIs

GymTech’sbackend

But first, Marco needs Peter to login and consent, using the Orange Identity APIs.

Orange Cloud APIs

Orange Identity APIs

As trusted party, Orange uses the ultimate Open ID Connect (OIDC) standard.

Orange Cloud APIs

Orange Identity APIs

Orange then calls back GymTech app or service platforms.

Orange Cloud APIs

Orange Identity APIs

Marco instantly integrated all these APIs in his code, thanks to the Orange SDKs.

Orange Cloud APIs

Orange Identity APIs

OrangeSDKs

// in main controller

- (void)viewDidLoad { [super viewDidLoad]; // Create the object that will make both user authentication // and cloud session management self.cloudSession = [[CloudSession alloc] initWithAppKey:@"yourClientId" appSecret:@"yourClientSecret" redirectURI:@"yourURIredirect"]; }

// in app delegate

- (void)applicationDidBecomeActive:(UIApplication *)application { [self.mainController connect]; }

Orange Identity & Cloud SDK

Marco also gets a complete sample code, ready to run and copy/paste…

// in main controller, how to connect:

- (void) connect { [self.cloudSession openSessionFrom:self success:^{ [self.cloudSession rootFolderWithSuccess:^(CloudItem * cloudItem) { [self setViewControllers:@[[[FileListViewController alloc] initWithSession:self.cloudSession

item:cloudItem]]]; } failure:^(CloudStatus status) { NSLog (@"Error while getting root folder"); }]; } failure:^(CloudStatus status) { NSLog (@"Error while connecting user"); }]; }

…with high-level SDK function calls, as shown here for iOS.

…same for Android, in MainActivity…

@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

if (savedInstanceState == null) { mStack = new Stack<OrangeCloudAPI.Entry>();

setContentView(R.layout.activity_main); mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_container); mSwipeRefreshLayout.setOnRefreshListener(this);

list = (ListView) findViewById(R.id.list); list.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {

// Get element at position and browse if it is a folder OrangeCloudAPI.Entry entry = (OrangeCloudAPI.Entry) adapter.getItem(i); if (entry.type == OrangeCloudAPI.Entry.Type.DIRECTORY) { browseFolders(entry); } else if (entry.type == OrangeCloudAPI.Entry.Type.IMAGE) { previewImage(entry); } } });

AuthSession session = new AuthSession(MainActivity.this, APP_KEY, APP_SECRET, APP_REDIRECT_URI); mApi = new OrangeCloudAPI<AuthSession>(session); session.startAuthentication(); } else {

mainStateNonce = savedInstanceState.getString("mainStateNonce"); } }

with a clean Open ID Connect session.

@Override protected void onResume() { super.onResume();

////////////////////////////////////////////////////////////////////////// // The next part must be inserted in the onResume() method of the // activity from which session.startAuthentication() was called, so // that Orange authentication completes properly. //////////////////////////////////////////////////////////////////////////

final AuthSession session = mApi.getSession();

// need to be sure that is first loading! if (mainStateNonce == null) { session.checkAuthentication(new OrangeListener.Success<String>() { @Override public void onResponse(String response) { // Have a valid session: // Browse the root folder and display its contents // null -> because we need root folder of app! browseFolders(null); mainStateNonce = "mainStateNonce";

} }, new OrangeListener.Error() { @Override public void onErrorResponse(OrangeAPIException error) { failure(error, true); } }); } }

Not to forget Python…

from pyorangecloud import OrangeCloudClient app = {'clientId':'xxx','clientSecret':'yyyyy','redirectUri':'http://my:redirect/uri'} client = OrangeCloudClient(app,authCode=‘xxx')

print("Available space: %s" % client.freespace())

print("Default folder list: ») folderInfo = client.listFolder() for f in folderInfo['subfolders']+folderInfo['files']: print (f['name'] + ' ' + f.get(‘type',''))

client.downloadFile(fileId, "/my/target/directory-or-file")

fileId = client.uploadFile("mypicture.jpg",folderInfo['id'],"@/my /file/location/mypicture.jpg")

… and even pure cURL shell script, for the braves :-)

# Get accessToken from refresh token response=$(curl -X POST \ -H 'Authorization:Basic '$AUTHORIZATION \ -H 'Content-Type:application/x-www-form-urlencoded' \ -d 'grant_type=refresh_token&refresh_token='$REFRESH_TOKEN \ https://api.orange.com/oauth/v2/token) if [[ $response =~ "error" ]]; then echo $(date '+%T')' get accessToken error: '$response exit -1 fi accessToken=$(jsonValue $response access_token)

# Get $ESID (session ID) response=$(curl -X POST \ -H 'Authorization:Bearer '$accessToken \ -H 'Content-Length:0' \ https://api.orange.com/cloud/v1/session) if [[ $response =~ "error" ]]; then echo $(date '+%T')' get sessionId error: '$response exit -1 fi sessionID=$(jsonValue $response esid)

# Upload a file from current directory to the end-user's cloud response=$(curl -k -S -X POST \ -H 'X-Orange-CA-ESID: '$sessionID \ -H 'Authorization: Bearer '$accessToken \ -F 'description={"name":"'$FILE_NAME'","size":'$FILE_SIZE'}' \ -F 'file=@'$FILE_NAME';filename='$FILE_NAME \ https://cloudapi.orange.com/cloud/v1/files/content) if [[ $response =~ "error" ]]; then echo $(date '+%T')' file upload error: '$response exit -1 fi fileID=$(jsonValue $response fileId) echo 'File successfully uploaded, with id: '$fileID

Self-service APIs

To get started, please visit www.orangepartner.com

You sign-up in 2 minutes, with your email as unique ID.

Your confirm your email and set your password.

You can browse and select APIs…

…read overviews and detailed documentation…

…check T&Cs…

…and declare an app or service in a single and short form.

This is a self-service workflow: your app is approved immediately.

You can then test APIs with Postman or RESTClient and start coding.

Go-to-market

In France for instance, partners can reach more than 4 millions Cloud users.

Orange Cloud:

4,000,000+ users

in France

The Orange Cloud homepage can feature partners’ apps and services

E.g. Forever’s films and VHS tape digitalization services…

…KDAN Pocket Scanner’s app that scans and uploads PDFs…

Peter

peter2020@orange.fr

…CloudFuze’s service that aggregates multiple clouds…

…and Family Place, the private network bundled in Orange Open offers.

Orange Services Mobile & webapps

End-users

Partners

API

orangepartner.com

Why are we doingthis?

At Orange, we used to develop our apps/services, eating our own cake.

Orange Services Mobile & webapps

End-users

Partners

API

orangepartner.com

We now enjoy sharing a much bigger cake with multiple partners/developers.

This is a virtuous circle for all: end-users, partners and Orange.

more usage & loyalty

more expertise & business

more possibilities & satisfaction

partners

end-users

thank you

orangepartner.com

@ThyGat

Recommended