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
スクラムガイドに載っていないスクラムのはじめかた - チームでスクラムをはじめるときに知っておきたい勘所を集めてみました! - / How to start Scrum that is not written in the Scrum Guide 2nd
takaking22
2
210
CDK CLIで使ってたあの機能、CDK Toolkit Libraryではどうやるの?
smt7174
4
190
LLMを搭載したプロダクトの品質保証の模索と学び
qa
1
1.1k
「何となくテストする」を卒業するためにプロダクトが動く仕組みを理解しよう
kawabeaver
0
440
いま注目のAIエージェントを作ってみよう
supermarimobros
0
360
株式会社ログラス - 会社説明資料【エンジニア】/ Loglass Engineer
loglass2019
4
65k
MagicPod導入から半年、オープンロジQAチームで実際にやったこと
tjoko
0
110
Automating Web Accessibility Testing with AI Agents
maminami373
0
1.3k
企業の生成AIガバナンスにおけるエージェントとセキュリティ
lycorptech_jp
PRO
3
200
使いやすいプラットフォームの作り方 ー LINEヤフーのKubernetes基盤に学ぶ理論と実践
lycorptech_jp
PRO
1
160
2つのフロントエンドと状態管理
mixi_engineers
PRO
3
160
開発者を支える Internal Developer Portal のイマとコレカラ / To-day and To-morrow of Internal Developer Portals: Supporting Developers
aoto
PRO
1
480
Featured
See All Featured
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.1k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
A better future with KSS
kneath
239
17k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Bash Introduction
62gerente
615
210k
[RailsConf 2023] Rails as a piece of cake
palkan
57
5.8k
Automating Front-end Workflow
addyosmani
1370
200k
It's Worth the Effort
3n
187
28k
Mobile First: as difficult as doing things right
swwweet
224
9.9k
Designing for Performance
lara
610
69k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
YesSQL, Process and Tooling at Scale
rocio
173
14k
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