Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Tools & Strategies for Consuming APIs
Search
Tonya Cooper
July 02, 2022
Technology
0
34
Tools & Strategies for Consuming APIs
Tonya Cooper
July 02, 2022
Tweet
Share
More Decks by Tonya Cooper
See All by Tonya Cooper
Custom Action Filters in ASP.NET MVC
tonyazen
0
110
Tools & Strategies for Consuming APIs V1
tonyazen
0
61
Testing_the_Endpoints_of_Your_REST_APIs.pdf
tonyazen
0
73
Other Decks in Technology
See All in Technology
データの整合性を保ちたいだけなんだ
shoheimitani
8
3.2k
制約が導く迷わない設計 〜 信頼性と運用性を両立するマイナンバー管理システムの実践 〜
bwkw
3
1k
予期せぬコストの急増を障害のように扱う――「コスト版ポストモーテム」の導入とその後の改善
muziyoshiz
1
2k
SREチームをどう作り、どう育てるか ― Findy横断SREのマネジメント
rvirus0817
0
340
生成AIを活用した音声文字起こしシステムの2つの構築パターンについて
miu_crescent
PRO
3
220
Oracle AI Database移行・アップグレード勉強会 - RAT活用編
oracle4engineer
PRO
0
110
SREのプラクティスを用いた3領域同時 マネジメントへの挑戦 〜SRE・情シス・セキュリティを統合した チーム運営術〜
coconala_engineer
2
770
ClickHouseはどのように大規模データを活用したAIエージェントを全社展開しているのか
mikimatsumoto
0
270
プロポーザルに込める段取り八分
shoheimitani
1
630
StrandsとNeptuneを使ってナレッジグラフを構築する
yakumo
1
120
量子クラウドサービスの裏側 〜Deep Dive into OQTOPUS〜
oqtopus
0
140
広告の効果検証を題材にした因果推論の精度検証について
zozotech
PRO
0
210
Featured
See All Featured
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
920
Design in an AI World
tapps
0
150
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
280
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
94
Site-Speed That Sticks
csswizardry
13
1.1k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
The Invisible Side of Design
smashingmag
302
51k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.7k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
For a Future-Friendly Web
brad_frost
182
10k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
120
Transcript
Tools & Strategies for Consuming APIs Tonya Cooper Quicken Loans
Software Engineer @tonyazen
Software Engineer Technology
None
None
third-party web • types • common components • integration tools
• coding strategies • communication • beer!
types
types rpc rest soap
rpc /GetAllBeers /GetBeer?beerid=001 rest /beers /beers/001
response types
[ { "Id": "1", "Name": "Red Eye Rye", "Style": "Rye",
"Abv": "6.7%", "BreweryId": "10003" }, { "Id": "2", "Name": "Poetic Pestilence", "Style": "India Pale Ale", "Abv": "11%", "BreweryId": "10004" }, …
<?xml version="1.0" encoding="ISO-8859-1"?> <root> <beers> <beer> <id>1</id> <name>Red Eye Rye</name>
<style>Rye</style> <abv>6.7%</abv> <breweryId>10003</breweryId> </beer> <beer> <id>2</id> <name>Poetic Pestilence</name> <style>India Pale Ale</style> <abv>11%</abv> …
a:1:{ s:5:"beers"; a:50:{ i:0; a:5:{ s:2:"Id"; s:1:"1"; s:4:"Name"; s:11:"Red Eye
Rye"; s:5:"Style"; s:3:"Rye"; s:3:"Abv"; s:4:"6.7%"; s:9:"BreweryId"; s:5:"10003"; …
[ { "Id": "1", "Name": "Red Eye Rye", "Style": "Rye",
"Abv": "6.7%", "BreweryId": "10003" }, { "Id": "2", "Name": "Poetic Pestilence", … format=json
if you want beer with SOAP… request response
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.o <soapenv:Header/> <soapenv:Body> <tem:GetAllBeers> <tem:getAllBeersRequest> <beer:BaseRequest> <beer:APIKey>ILoveBeer</beer:APIKey> <beer:ClientCode>TonyaZen</beer:ClientCode <beer:RequestId>b9fa635a-6e0d-4de6-9431-ac
<beer:Version>1.02</beer:Version> </beer:BaseRequest> </tem:getAllBeersRequest> </tem:GetAllBeers> </soapenv:Body> </soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.o <soapenv:Header/> <soapenv:Body> <tem:GetAllBeers> <tem:getAllBeersRequest> <beer:BaseRequest> <beer:APIKey>ILoveBeer</beer:APIKey> <beer:ClientCode>TonyaZen</beer:ClientCode <beer:RequestId>b9fa635a-6e0d-4de6-9431-ac
<beer:Version>1.02</beer:Version> </beer:BaseRequest> </tem:getAllBeersRequest> </tem:GetAllBeers> </soapenv:Body> </soapenv:Envelope> <beer:APIKey>ILoveBeer</beer:APIKey> <beer:ClientCode>TonyaZen</beer:ClientCode <beer:RequestId>b9fa635a-6e0d-4de6-9431-ac <beer:Version>1.02</beer:Version>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/enve <s:Body> <GetAllBeersResponse xmlns="http://beerexample.com/ <GetAllBeersResult xmlns:a="http://schemas.datac <a:BaseResponse> <a:DisplayErrorMessage i:nil="true"/>
<a:RequestId>b9fa635a-6e0d-4de6-9431-acee1 <a:RequestTimeStamp>2019-02-14T21:01:19.15 <a:ResponseStatus>Success</a:ResponseStatu <a:TechnicalErrorMessage i:nil="true"/> </a:BaseResponse> <a:Beers xmlns:b="http://schemas.datacontract <b:Beer> <b:Abv>6.6%</b:Abv> <b:Brewery>Founder's Brewing Co.</b:B …
components
components pagination filtering security
pagination large datasets
pagination large datasets conserve resources
pagination large datasets conserve resources improve response time
page=3 pagination
page=3 size=100 pagination
first item=300 size=100 pagination
filtering style=ipa
• username / password • API key • token •
session ID authentication & authorization
integration tools
demo
coding strategies
None
public interface IBeerServices { BeersResponse GetBeers(); BeerResponse GetBeer(string id); BeerResponse
AddBeer(Beer beer); BeerResponse UpdateBeer(Beer beer); BaseResponse DeleteBeer(string id); }
public class BeersResponse : BaseResponse { public List<Beer> Beers {
get; set; } } public class BaseResponse { public bool Success { get; set; } public string Message { get; set; } }
public class BeersResponse : BaseResponse { public List<Beer> Beers {
get; set; } } public class BaseResponse { public bool Success { get; set; } public string Message { get; set; } } public bool Success { get; set; }
try { var response = beerService.GetBeers(); … } catch(Exception ex)
{ _logger.ErrorFormat("…"); … }
_logger.ErrorFormat($“process failed for client: {request.ClientCode}, requestId: {request.RequestId}, beer: {request.Beer.Name}, brewery:
{request.Beer.Brewery}, exception: {ex}.");
our object string Id string Name string Abv BeerStyle Style
string Description bool IsOnTap Brewery Brewery
our object string Id string Name string Abv BeerStyle Style
string Description bool IsOnTap Brewery Brewery 1 long BeerId string Name decimal Abv string Style string Description long Brewery
our object string Id string Name string Abv BeerStyle Style
string Description bool IsOnTap Brewery Brewery 1 long BeerId string Name decimal Abv string Style string Description long Brewery
our object string Id string Name string Abv BeerStyle Style
string Description bool IsOnTap Brewery Brewery
our object string Id string Name string Abv BeerStyle Style
string Description bool IsOnTap Brewery Brewery 2 string Id string Name string Abv Style Style string Description string Brewery
our object string Id string Name string Abv BeerStyle Style
string Description bool IsOnTap Brewery Brewery 2 string Id string Name string Abv Style Style string Description string Brewery
None
code review • separate service layer • interface for your
service class • response objects • try / catches • logging • use your own objects • cache results
communicating with owner
cheers to good communication • First…consult the documentation • Utilize
their ticketing system • Provide raw request and response • Be NICE!
Thank you! Tonya Cooper Quicken Loans Software Engineer @tonyazen