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
32
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
60
Testing_the_Endpoints_of_Your_REST_APIs.pdf
tonyazen
0
70
Other Decks in Technology
See All in Technology
自律的なスケーリング手法FASTにおけるVPoEとしてのアカウンタビリティ / dev-productivity-con-2025
yoshikiiida
2
17k
MobileActOsaka_250704.pdf
akaitadaaki
0
130
成長し続けるアプリのためのテストと設計の関係、そして意思決定の記録。
sansantech
PRO
0
120
AI専用のリンターを作る #yumemi_patch
bengo4com
5
4.3k
「クラウドコスト絶対削減」を支える技術—FinOpsを超えた徹底的なクラウドコスト削減の実践論
delta_tech
4
170
american airlines®️ USA Contact Numbers: Complete 2025 Support Guide
supportflight
1
110
AI時代の開発生産性を加速させるアーキテクチャ設計
plaidtech
PRO
3
160
Core Audio tapを使ったリアルタイム音声処理のお話
yuta0306
0
190
Tokyo_reInforce_2025_recap_iam_access_analyzer
hiashisan
0
190
LangSmith×Webhook連携で実現するプロンプトドリブンCI/CD
sergicalsix
1
240
高速なプロダクト開発を実現、創業期から掲げるエンタープライズアーキテクチャ
kawauso
2
9.5k
マネジメントって難しい、けどおもしろい / Management is tough, but fun! #em_findy
ar_tama
7
1.1k
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Become a Pro
speakerdeck
PRO
29
5.4k
The Pragmatic Product Professional
lauravandoore
35
6.7k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
The Straight Up "How To Draw Better" Workshop
denniskardys
234
140k
Site-Speed That Sticks
csswizardry
10
690
The Cult of Friendly URLs
andyhume
79
6.5k
RailsConf 2023
tenderlove
30
1.1k
Writing Fast Ruby
sferik
628
62k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
690
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