SlideShare a Scribd company logo
1 of 17
Wretch Open API
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Introduction ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Get UGC (commercial) API Oauth (authentication)API John
Introduction ,[object Object],[object Object],[object Object]
API List (I) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
API List (II) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
API List (III) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
API List (IV) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
API List (V) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
API List (VI) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Data access policy (I) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Data access policy (II) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Format Request = Action + URI Response = Status Code + body Status code Meaning of status code 200 query format  正確 ,  且有  result 204 query format  正確 ,  但沒有  result (ex:  相簿裡沒有相片 ) 404 query format  有誤 ,  包含 : error typing,  格式錯誤 ,  或是此 resource  不存在  (ex:  沒開啟服務 )  等 406 沒有指定  valid accept format ( 包含  application/xml  及  application/json),  請用  format  參數指定或是在 request header 中的  accept  指定為  valid value
Examples ,[object Object],<?php define(&quot;API_KEY&quot;,&quot;dj0yJmk9MUdiT0lHRU92MXMzJmQ9WVdrOU5taGhjVlpNTnpJb WNHbzlNVGc0TWpJd056VTJNUS0tJnM9Y29uc3VtZXJzZWNyZXQmeD1kNw--&quot;); define(&quot;SHARED_SECRET&quot;, &quot;f258b755c0a0b267f44dc594ec28a380cbabfc8c&quot;); define(&quot;APP_ID&quot;,  &quot;6haqVL72&quot;); // Initializes session and redirects user to Yahoo! to sign in and then authorize app $yahoo_session = YahooSession::requireSession(API_KEY, SHARED_SECRET, APP_ID); $url = 'http://wretch.yahooapis.com/v1/profileService/'.$yahoo_user->guid; // Call Wretch API $response = $yahoo_session->client->get($url); print_r($response); ?>
Examples ,[object Object],<?php define(&quot;API_KEY&quot;,&quot;dj0yJmk9MUdiT0lHRU92MXMzJmQ9WVdrOU5taGhjVlpNTnpJb WNHbzlNVGc0TWpJd056VTJNUS0tJnM9Y29uc3VtZXJzZWNyZXQmeD1kNw--&quot;); define(&quot;SHARED_SECRET&quot;, &quot;f258b755c0a0b267f44dc594ec28a380cbabfc8c&quot;); define(&quot;APP_ID&quot;,  &quot;6haqVL72&quot;); // Initializes session and redirects user to Yahoo! to sign in and then authorize app $yahoo_session = YahooSession::requireSession(API_KEY, SHARED_SECRET, APP_ID); $url = 'http://wretch.yahooapis.com/v1/albumService/'.$yahoo_user->guid.’/albums’; // Call Wretch API $response = $yahoo_session->client->post($url, $contentType, $content); print_r($response); ?>
References ,[object Object],[object Object],[object Object],[object Object]

More Related Content

Similar to TWOHD_Wretch API

Rest Ruby On Rails
Rest Ruby On RailsRest Ruby On Rails
Rest Ruby On Railsshaokun
 
HTML+COIMOTION 開發跨平台 app
HTML+COIMOTION 開發跨平台 appHTML+COIMOTION 開發跨平台 app
HTML+COIMOTION 開發跨平台 appBen Lue
 
在雲端上啜飲爪哇
在雲端上啜飲爪哇在雲端上啜飲爪哇
在雲端上啜飲爪哇建興 王
 
11个步骤应用Spring Security 3(西安尚学堂~付老实)
11个步骤应用Spring Security 3(西安尚学堂~付老实)11个步骤应用Spring Security 3(西安尚学堂~付老实)
11个步骤应用Spring Security 3(西安尚学堂~付老实)Underwind
 
11个步骤应用Spring Security 3
11个步骤应用Spring Security 311个步骤应用Spring Security 3
11个步骤应用Spring Security 3Underwind
 
Django讲座
Django讲座Django讲座
Django讲座Qing Feng
 
廖雪峰 Saa s ovp
廖雪峰 Saa s ovp廖雪峰 Saa s ovp
廖雪峰 Saa s ovpdrewz lin
 
Google App Engine Devfest 200810 External
Google App Engine Devfest 200810 ExternalGoogle App Engine Devfest 200810 External
Google App Engine Devfest 200810 Externaljunyu
 
Cas Sso Intro
Cas Sso IntroCas Sso Intro
Cas Sso IntroShiny Zhu
 
Asp.net mvc 培训
Asp.net mvc 培训Asp.net mvc 培训
Asp.net mvc 培训lotusprince
 
微软Bot framework简介
微软Bot framework简介微软Bot framework简介
微软Bot framework简介Zhichao Liang
 
Ajax Transportation Methods
Ajax Transportation MethodsAjax Transportation Methods
Ajax Transportation Methodsyiditushe
 
HTML5概览
HTML5概览HTML5概览
HTML5概览Adam Lu
 
张所勇:前端开发工具推荐
张所勇:前端开发工具推荐张所勇:前端开发工具推荐
张所勇:前端开发工具推荐zhangsuoyong
 
與 Sign in with Apple 的愛恨情仇 @ iPlayground2020
與 Sign in with Apple 的愛恨情仇 @ iPlayground2020與 Sign in with Apple 的愛恨情仇 @ iPlayground2020
與 Sign in with Apple 的愛恨情仇 @ iPlayground2020Johnny Sung
 
Open Api&Sip
Open Api&SipOpen Api&Sip
Open Api&Sipcenwenchu
 
Google cloud message by sean
Google cloud message by seanGoogle cloud message by sean
Google cloud message by seanSean Lee
 
Django
DjangoDjango
DjangoTao He
 
Using google appengine (2)
Using google appengine (2)Using google appengine (2)
Using google appengine (2)Wei Sun
 

Similar to TWOHD_Wretch API (20)

Rest Ruby On Rails
Rest Ruby On RailsRest Ruby On Rails
Rest Ruby On Rails
 
HTML+COIMOTION 開發跨平台 app
HTML+COIMOTION 開發跨平台 appHTML+COIMOTION 開發跨平台 app
HTML+COIMOTION 開發跨平台 app
 
在雲端上啜飲爪哇
在雲端上啜飲爪哇在雲端上啜飲爪哇
在雲端上啜飲爪哇
 
11个步骤应用Spring Security 3(西安尚学堂~付老实)
11个步骤应用Spring Security 3(西安尚学堂~付老实)11个步骤应用Spring Security 3(西安尚学堂~付老实)
11个步骤应用Spring Security 3(西安尚学堂~付老实)
 
11个步骤应用Spring Security 3
11个步骤应用Spring Security 311个步骤应用Spring Security 3
11个步骤应用Spring Security 3
 
Django讲座
Django讲座Django讲座
Django讲座
 
廖雪峰 Saa s ovp
廖雪峰 Saa s ovp廖雪峰 Saa s ovp
廖雪峰 Saa s ovp
 
Google App Engine Devfest 200810 External
Google App Engine Devfest 200810 ExternalGoogle App Engine Devfest 200810 External
Google App Engine Devfest 200810 External
 
Cas Sso Intro
Cas Sso IntroCas Sso Intro
Cas Sso Intro
 
Asp.net mvc 培训
Asp.net mvc 培训Asp.net mvc 培训
Asp.net mvc 培训
 
微软Bot framework简介
微软Bot framework简介微软Bot framework简介
微软Bot framework简介
 
Ajax Transportation Methods
Ajax Transportation MethodsAjax Transportation Methods
Ajax Transportation Methods
 
HTML5概览
HTML5概览HTML5概览
HTML5概览
 
张所勇:前端开发工具推荐
张所勇:前端开发工具推荐张所勇:前端开发工具推荐
张所勇:前端开发工具推荐
 
與 Sign in with Apple 的愛恨情仇 @ iPlayground2020
與 Sign in with Apple 的愛恨情仇 @ iPlayground2020與 Sign in with Apple 的愛恨情仇 @ iPlayground2020
與 Sign in with Apple 的愛恨情仇 @ iPlayground2020
 
Open Api&Sip
Open Api&SipOpen Api&Sip
Open Api&Sip
 
Google cloud message by sean
Google cloud message by seanGoogle cloud message by sean
Google cloud message by sean
 
Django
DjangoDjango
Django
 
Using google appengine (2)
Using google appengine (2)Using google appengine (2)
Using google appengine (2)
 
Osgi Intro
Osgi IntroOsgi Intro
Osgi Intro
 

More from JH Lee

K+ Open Api For 2009 Yahoo! Open Hack Day By Sc@20091017
K+ Open Api For 2009 Yahoo! Open Hack Day By Sc@20091017K+ Open Api For 2009 Yahoo! Open Hack Day By Sc@20091017
K+ Open Api For 2009 Yahoo! Open Hack Day By Sc@20091017JH Lee
 
Y Boss External 20091017
Y Boss External 20091017Y Boss External 20091017
Y Boss External 20091017JH Lee
 
2009 Hackday Taiwan Yui
2009 Hackday Taiwan Yui2009 Hackday Taiwan Yui
2009 Hackday Taiwan YuiJH Lee
 
C A S Sample Php
C A S Sample PhpC A S Sample Php
C A S Sample PhpJH Lee
 
Yql V8
Yql V8Yql V8
Yql V8JH Lee
 
Erikeldridge Yos V9
Erikeldridge Yos V9Erikeldridge Yos V9
Erikeldridge Yos V9JH Lee
 
TWOHD_Search Monkey
TWOHD_Search MonkeyTWOHD_Search Monkey
TWOHD_Search MonkeyJH Lee
 
TWOHD_Blueprint
TWOHD_BlueprintTWOHD_Blueprint
TWOHD_BlueprintJH Lee
 

More from JH Lee (8)

K+ Open Api For 2009 Yahoo! Open Hack Day By Sc@20091017
K+ Open Api For 2009 Yahoo! Open Hack Day By Sc@20091017K+ Open Api For 2009 Yahoo! Open Hack Day By Sc@20091017
K+ Open Api For 2009 Yahoo! Open Hack Day By Sc@20091017
 
Y Boss External 20091017
Y Boss External 20091017Y Boss External 20091017
Y Boss External 20091017
 
2009 Hackday Taiwan Yui
2009 Hackday Taiwan Yui2009 Hackday Taiwan Yui
2009 Hackday Taiwan Yui
 
C A S Sample Php
C A S Sample PhpC A S Sample Php
C A S Sample Php
 
Yql V8
Yql V8Yql V8
Yql V8
 
Erikeldridge Yos V9
Erikeldridge Yos V9Erikeldridge Yos V9
Erikeldridge Yos V9
 
TWOHD_Search Monkey
TWOHD_Search MonkeyTWOHD_Search Monkey
TWOHD_Search Monkey
 
TWOHD_Blueprint
TWOHD_BlueprintTWOHD_Blueprint
TWOHD_Blueprint
 

TWOHD_Wretch API

  • 2.
  • 3.
  • 4. Get UGC (commercial) API Oauth (authentication)API John
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14. Format Request = Action + URI Response = Status Code + body Status code Meaning of status code 200 query format 正確 , 且有 result 204 query format 正確 , 但沒有 result (ex: 相簿裡沒有相片 ) 404 query format 有誤 , 包含 : error typing, 格式錯誤 , 或是此 resource 不存在 (ex: 沒開啟服務 ) 等 406 沒有指定 valid accept format ( 包含 application/xml 及 application/json), 請用 format 參數指定或是在 request header 中的 accept 指定為 valid value
  • 15.
  • 16.
  • 17.