Orange APIs Orange Partner MobileBankingFactory2 Challenge / Th Gaillet March 14, 2015
Business Services
Fleet management partnership• Orange Fleet performance
• Peugeot Connect Fleet management
• Citroën Connect Fleet management
B2B2C example, at the gym
> >
MarcoGymTech CTO
develops & manages solutions for multiple
gym clubs
PeterGym customer
expects the bestexperience, with relevant
interactions & privacy
JimGym manager
wants to boost hisbusiness & know his
customers better
Orange Beacon
Beacons
mobile appsAPIs via
SDKs
Partner’sapp
Orange Beaconplatform
Partner’sportal
management & analyticsAPIs
Partner’s platforms
Partner
Orangeportal
Gym Manager
Orangeapp
Settings
Orange
DatavenueAPIs
Marco,GymTech CTO
Datavenue portal
Access API
GymTech’s platforms
GymTech’s 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
…resources like Peter’s personalcloud
Marco developed a GymTech app…
…for end-userslike Peter
this app needs to access user’s resources…
Orange Cloud
Partner’sapp
CloudAPI
IdentityAuthorization
Open ID Connect API User Details API
Client’spersonalcloud
Client’sdevices
CloudAPI
Partner’sbackend
Orange
Cloud
Uploader
#!/bin/bash # OrangeCloud_uploader.sh # … CLIENT_ID="gVZ0rd4zQDQ..a.dbP0iuWF" CLIENT_SECRET="R6zYmsIEgtSIMWIA" AUTHORIZATION=$(encodeBase64 $CLIENT_ID':'$CLIENT_SECRET) REFRESH_TOKEN="OFR-d8e439…92a1f7e4a7e1b9c812ba"
# File to upload FILE_NAME="weather.png" FILE_SIZE=$(stat -f%z « $FILE_NAME")
# [1] Obtain 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)
Orange
Cloud
Uploader
# [2] 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) # [3] Upload a file from current directory to 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
Orange
Cloud
SDK
// 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]; }
// 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"); }]; }
Orange
Cloud
SDK