SlideShare a Scribd company logo
Common Mistakes When
Calling Smarty APIs
Status Codes 401 and 402
In today’s webinar, we’ll cover two types of mistakes:
“Authentication Required” errors — status code 401
“Payment Required” errors — status code 402
“Authentication Required” Errors — Status Code 401
In this section:
● How to authenticate API requests the right way
● Common mistakes in client-side requests
● Common mistakes in server-side requests
How to Authenticate API Requests the Right Way
1. Get familiar with your account's API Keys page.
How to Authenticate API Requests the Right Way
1. Get familiar with your account's API Keys page.
2. Understand the difference between client-side requests (in a web browser) and server-side
requests. Since browsers send a Referer header automatically, our system treats any request that
includes a Referer header as a client-side request. In contrast, if the request does NOT have a
Referer header, our system treats it is a server-side request.
How to Authenticate API Requests the Right Way
1. Get familiar with your account's API Keys page.
2. Understand the difference between client-side requests (in a web browser) and server-side
requests. Since browsers send a Referer header automatically, our system treats any request that
includes a Referer header as a client-side request. In contrast, if the request does NOT have that
header, our system treats it is a server-side request.
3. For client-side calls:
● Include an embedded key in the request URL: key=31050191824945
● Make sure that the Referer value sent by the browser is listed as a host for the embedded key
being used.
How to Authenticate API Requests the Right Way
1. Get familiar with your account's API Keys page.
2. Understand the difference between client-side requests (in a web browser) and server-side
requests. Since browsers send a Referer header automatically, our system treats any request that
includes a Referer header as a client-side request. In contrast, if the request does NOT have that
header, our system treats it is a server-side request.
3. For client-side calls:
● Include an embedded key in the request URL: key=31050191824945
● Make sure that the Referer value sent by the browser is listed as a host for the embedded key
being used.
1. For server-side calls:
● Include the secret keys (auth-id and auth-token) in the request URL: auth-
id=a1Gf2rC&auth-token=HH3tnV
Common Mistakes in Client-Side Requests
● Don't submit secret keys in a client-side request.
Common Mistakes in Client-Side Requests
● Don't submit secret keys in a client-side request.
● Don't list the wrong referer/host value with the embedded key. (Look between the slashes of
the referer value.)
Common Mistakes in Client-Side Requests
● Don't submit secret keys in a client-side request.
● Don't list the wrong referer/host value with the embedded key. (Look between the slashes of
the referer value.)
○ For localhost, just list "localhost" without the port number.
○ For calls from the jsfiddle website, the correct host is fiddle.jshell.net
Common Mistakes in Client-Side Requests
● Don't submit secret keys in a client-side request.
● Don't list the wrong referer/host value with the embedded key. (Look between the slashes of
the referer value.)
○ For localhost, just list "localhost" without the port number.
○ For calls from the jsfiddle website, the correct host is fiddle.jshell.net
● When using a wildcard in a hostname, don't use the * for more than one level of subdomain.
For example:
complete referer value: www.accounts.smarty.com
correct: *.accounts.smarty.com
incorrect: *.smarty.com
Common Mistakes in Client-Side Requests
● Don't submit secret keys in a client-side request.
● Don't list the wrong referer/host value with the embedded key. (Look between the slashes of
the referer value.)
○ For localhost, just list "localhost" without the port number.
○ For calls from the jsfiddle website, the correct host is fiddle.jshell.net
● When using a wildcard in a hostname, don't use the * for more than one level of subdomain.
● Don't forget to explicitly set up a Referer header when calling from a mobile app or when using
an embedded key in Postman. (Mobile apps and Postman don't send a Referer header by
default, so you will need to set one up manually.)
Common Mistakes in Client-Side Requests
● Don't submit secret keys in a client-side request.
● Don't list the wrong referer/host value with the embedded key. (Look between the slashes of
the referer value.)
○ For localhost, just list "localhost" without the port number.
○ For calls from the jsfiddle website, the correct host is fiddle.jshell.net
● When using a wildcard in a hostname, don't use the * for more than one level of subdomain.
● Don't forget to explicitly set up a Referer header when calling from a mobile app or when using
an embedded key in Postman. (Mobile apps and Postman don't send a Referer header by
default, so you will need to set one up manually.)
● Don't forget to URL-encode the request URL. For example, a # symbol that is not URL-
encoded will break up the request URL, and our system will not recognize any part of the URL
after the # symbol.
Common Mistakes in Server-Side Requests
● Don't send an embedded key in a server-side request.
Common Mistakes in Server-Side Requests
● Don't send an embedded key in a server-side request.
● Don't type the auth-id or auth-token by hand; you might mistype a 1 for a lower-case l or a 0
for a capital O.
Common Mistakes in Server-Side Requests
● Don't send an embedded key in a server-side request.
● Don't type the auth-id or auth-token by hand; you might mistype a 1 for a lower-case l or a 0
for a capital O.
● Don't forget to URL-encode the request URL.
“Payment Required” Errors — Status Code 402
In this section:
● Understanding your Smarty account and your licenses
● Common mistakes that result in a "Payment Required" error
Understanding Your Smarty Account and Your Licenses
● If you are a developer trying to work with the Smarty APIs, we recommend that you be able to
log in to the Smarty account you are trying to use. Currently, each Smarty account has only a
single login email and password, so you would need to obtain those login details from
whomever has them.
Understanding Your Smarty Account and Your Licenses
● If you are a developer trying to work with the Smarty APIs, we recommend that you be able to
log in to the Smarty account you are trying to use. Currently, each Smarty account has only a
single login email and password, so you would need to obtain those login details from
whomever has them.
● Be familiar with the different pages available in your account, especially the Subscriptions and
API Keys pages.
Understanding Your Smarty Account and Your Licenses
● If you are a developer trying to work with the Smarty APIs, we recommend that you be able to
log in to the Smarty account you are trying to use. Currently, each Smarty account has only a
single login email and password, so you would need to obtain those login details from
whomever has them.
● Be familiar with the different pages available in your account, especially the Subscriptions and
API Keys pages.
● Make sure you understand your licenses. Know which APIs they allow you to call and what
specific abilities are included. Because we offer so many different licenses, distinguishing
them can be tricky. Feel free to ask the Support team or your sales rep about the abilities of
any particular license.
Common Mistakes That Result in a Payment Required Error
● Don't use API keys from the wrong account. Many companies have multiple Smarty accounts
— for example, a production account and several accounts used by individual developers.
Make sure the auth credentials you are submitting in the request URL pertain to the account
that actually has the right subscription in it.
Common Mistakes That Result in a Payment Required Error
● Don't use API keys from the wrong account.
● Don't try to call an API that is not supported by one of your licenses. Example: You try to call
the US Autocomplete Pro API, but you only have a US Address Verification subscription, with
a US Core Edition license. (Our US Autocomplete service requires its own license.)
Common Mistakes That Result in a Payment Required Error
● Don't use API keys from the wrong account.
● Don't try to call an API that is not supported by one of your licenses.
● If using one of our SDKs, don't assume that the license value listed in the Github example
code is the right one. Example: The default license listed in the Github example code is us-
rooftop-geocoding-cloud, but you don't actually have a Rooftop Geocoding license. You
may need to change the license value to us-core-cloud or us-standard-cloud. This
line is from the JavaScript SDK:
let clientBuilder = new SmartyCore.ClientBuilder(credentials)
.withBaseUrl("YOUR URL").withLicenses(["us-rooftop-geocoding-cloud"]);
Common Mistakes That Result in a Payment Required Error
● Don't use API keys from the wrong account.
● Don't try to call an API that is not supported by one of your licenses.
● If using one of our SDKs, don't assume that the license value listed in the Github example
code is the right one.
● Don't try to use an ability that doesn't pertain to your specific license. Examples:
○ When calling our US Street Address API, you include match=enhanced, but you don't have a US
Core Edition license. You only have the older US Standard Edition license (which doesn’t include
enhanced matching).
Common Mistakes That Result in a Payment Required Error
● Don't use API keys from the wrong account.
● Don't try to call an API that is not supported by one of your licenses.
● If using one of our SDKs, don't assume that the license value listed in the Github example
code is the right one.
● Don't try to use an ability that doesn't pertain to your specific license. Examples:
○ When calling our US Street Address API, you include match=enhanced, but you don't have a US
Core Edition license. You only have the older US Standard Edition license (which doesn’t include
enhanced matching).
○ When calling our International Street API, you include geocode=true, but your license is an
International Global Basic license that doesn't include geocodes.
Common Mistakes That Result in a Payment Required Error
● Don't use API keys from the wrong account.
● Don't try to call an API that is not supported by one of your licenses.
● If using one of our SDKs, don't assume that the license value listed in the Github example
code is the right one.
● Don't try to use an ability that doesn't pertain to your specific license. Examples:
○ When calling our US Street Address API, you include match=enhanced, but you don't have a US
Core Edition license. You only have the older US Standard Edition license (which doesn’t include
enhanced matching).
○ When calling our International Street API, you include geocode=true, but your license is an
International Global Basic license that doesn't include geocodes.
○ When calling our International Street API, you submit an address from a country not included with your
particular license.
Finishing Up
The Smarty Support team is here for you. We pride ourselves on being super responsive.
Our regular hours are weekdays 8 to 5 Mountain Time.
Phone: 801-877-5778
Chat: smarty.com
Email: support@smarty.com
Try our APIs for free!
smarty.com/signup

More Related Content

What's hot

Presentation on Business Ethics
Presentation on Business EthicsPresentation on Business Ethics
Presentation on Business Ethics
Jatin Suthar
 
Personal Branding
Personal BrandingPersonal Branding
Personal Branding
Sohan Khatri
 
10 Steps to Personal Branding
10 Steps to Personal Branding10 Steps to Personal Branding
10 Steps to Personal Branding
Joe Pulizzi
 
Vision Mission - Statement English
Vision Mission - Statement EnglishVision Mission - Statement English
Vision Mission - Statement English
Daniel de Carvalho Luz
 
Qlc winning jack welch
Qlc winning   jack welchQlc winning   jack welch
Qlc winning jack welch
Ali Al-Khelaifi
 
About Management Consulting
About Management ConsultingAbout Management Consulting
About Management Consulting
Deepak Pareek
 
THE EFFECTIVE PUBLIC RELATIONS STRATEGY
THE EFFECTIVE PUBLIC RELATIONS STRATEGY THE EFFECTIVE PUBLIC RELATIONS STRATEGY
THE EFFECTIVE PUBLIC RELATIONS STRATEGY
Beinomugisha Ronald Katungi
 
Personal branding
Personal brandingPersonal branding
Quarterly Business Growth Analysis And Development PowerPoint Presentation Sl...
Quarterly Business Growth Analysis And Development PowerPoint Presentation Sl...Quarterly Business Growth Analysis And Development PowerPoint Presentation Sl...
Quarterly Business Growth Analysis And Development PowerPoint Presentation Sl...
SlideTeam
 
Personal Branding
Personal BrandingPersonal Branding
Personal Branding
techie-prof
 
Jim Kouzes - The Leadership Challenge
Jim Kouzes - The Leadership ChallengeJim Kouzes - The Leadership Challenge
Jim Kouzes - The Leadership Challenge
South Bay Organization Development Network
 
Reputation management
Reputation management Reputation management
Reputation management
vildan esenyel
 
How to create and inspire trust in leadership
How to create and inspire trust in leadershipHow to create and inspire trust in leadership
How to create and inspire trust in leadership
Full Circle Image
 
Self leadership
Self leadershipSelf leadership
Self leadership
Paulo Sambo
 
Personal Branding Presentation
Personal Branding PresentationPersonal Branding Presentation
Personal Branding Presentation
acrain
 
1.2 Recognizing Arguments
1.2   Recognizing Arguments1.2   Recognizing Arguments
1.2 Recognizing Arguments
Nicholas Lykins
 
Chapter 8 - Evaluation
Chapter 8 - EvaluationChapter 8 - Evaluation
Chapter 8 - Evaluation
jbraun128
 
Self Leadership
Self LeadershipSelf Leadership
Self Leadership
Anurag Kanoongo
 
How to quit quitting?
How to quit quitting?How to quit quitting?
How to quit quitting?
Rebecca Davidson
 
5w Pr Planning
5w Pr Planning5w Pr Planning
5w Pr Planning
Thomas Barat
 

What's hot (20)

Presentation on Business Ethics
Presentation on Business EthicsPresentation on Business Ethics
Presentation on Business Ethics
 
Personal Branding
Personal BrandingPersonal Branding
Personal Branding
 
10 Steps to Personal Branding
10 Steps to Personal Branding10 Steps to Personal Branding
10 Steps to Personal Branding
 
Vision Mission - Statement English
Vision Mission - Statement EnglishVision Mission - Statement English
Vision Mission - Statement English
 
Qlc winning jack welch
Qlc winning   jack welchQlc winning   jack welch
Qlc winning jack welch
 
About Management Consulting
About Management ConsultingAbout Management Consulting
About Management Consulting
 
THE EFFECTIVE PUBLIC RELATIONS STRATEGY
THE EFFECTIVE PUBLIC RELATIONS STRATEGY THE EFFECTIVE PUBLIC RELATIONS STRATEGY
THE EFFECTIVE PUBLIC RELATIONS STRATEGY
 
Personal branding
Personal brandingPersonal branding
Personal branding
 
Quarterly Business Growth Analysis And Development PowerPoint Presentation Sl...
Quarterly Business Growth Analysis And Development PowerPoint Presentation Sl...Quarterly Business Growth Analysis And Development PowerPoint Presentation Sl...
Quarterly Business Growth Analysis And Development PowerPoint Presentation Sl...
 
Personal Branding
Personal BrandingPersonal Branding
Personal Branding
 
Jim Kouzes - The Leadership Challenge
Jim Kouzes - The Leadership ChallengeJim Kouzes - The Leadership Challenge
Jim Kouzes - The Leadership Challenge
 
Reputation management
Reputation management Reputation management
Reputation management
 
How to create and inspire trust in leadership
How to create and inspire trust in leadershipHow to create and inspire trust in leadership
How to create and inspire trust in leadership
 
Self leadership
Self leadershipSelf leadership
Self leadership
 
Personal Branding Presentation
Personal Branding PresentationPersonal Branding Presentation
Personal Branding Presentation
 
1.2 Recognizing Arguments
1.2   Recognizing Arguments1.2   Recognizing Arguments
1.2 Recognizing Arguments
 
Chapter 8 - Evaluation
Chapter 8 - EvaluationChapter 8 - Evaluation
Chapter 8 - Evaluation
 
Self Leadership
Self LeadershipSelf Leadership
Self Leadership
 
How to quit quitting?
How to quit quitting?How to quit quitting?
How to quit quitting?
 
5w Pr Planning
5w Pr Planning5w Pr Planning
5w Pr Planning
 

Similar to The Most Common Mistakes When Calling Smarty APIs

Overview on ring central errors
Overview on ring central errorsOverview on ring central errors
Overview on ring central errors
Anirban Sen Chowdhary
 
How to build Simple yet powerful API.pptx
How to build Simple yet powerful API.pptxHow to build Simple yet powerful API.pptx
How to build Simple yet powerful API.pptx
Channa Ly
 
OAuth 2.0
OAuth 2.0OAuth 2.0
OAuth 2.0
Mihir Shah
 
Ch 5: Bypassing Client-Side Controls
Ch 5: Bypassing Client-Side ControlsCh 5: Bypassing Client-Side Controls
Ch 5: Bypassing Client-Side Controls
Sam Bowne
 
ArcSight Enterprise View REST API Developer's Guide
ArcSight Enterprise View REST API Developer's GuideArcSight Enterprise View REST API Developer's Guide
ArcSight Enterprise View REST API Developer's Guide
Protect724gopi
 
OAuth SPOP @ IETF 91
OAuth SPOP @ IETF 91OAuth SPOP @ IETF 91
OAuth SPOP @ IETF 91
Nat Sakimura
 
What API Specifications and Tools Help Engineers to Construct a High-Security...
What API Specifications and Tools Help Engineers to Construct a High-Security...What API Specifications and Tools Help Engineers to Construct a High-Security...
What API Specifications and Tools Help Engineers to Construct a High-Security...
Hitachi, Ltd. OSS Solution Center.
 
Build and graduate your app in ring central
Build and graduate your app in ring centralBuild and graduate your app in ring central
Build and graduate your app in ring central
Anirban Sen Chowdhary
 
Creating a Sign On with Open id connect
Creating a Sign On with Open id connectCreating a Sign On with Open id connect
Creating a Sign On with Open id connect
Derek Binkley
 
Create custom authentication provider and forget the hassle of managing token...
Create custom authentication provider and forget the hassle of managing token...Create custom authentication provider and forget the hassle of managing token...
Create custom authentication provider and forget the hassle of managing token...
Rahul Malhotra
 
Setting up BuzzCity Account - Server Side API
Setting up BuzzCity Account - Server Side APISetting up BuzzCity Account - Server Side API
Setting up BuzzCity Account - Server Side API
BuzzCity-2015
 
Big commerce app development
Big commerce app developmentBig commerce app development
Big commerce app development
Nascenia IT
 
RefCard RESTful API Design
RefCard RESTful API DesignRefCard RESTful API Design
RefCard RESTful API Design
OCTO Technology
 
RESTful services and OAUTH protocol in IoT
RESTful services and OAUTH protocol in IoTRESTful services and OAUTH protocol in IoT
RESTful services and OAUTH protocol in IoT
Yakov Fain
 
[OPD 2019] Inter-application vulnerabilities
[OPD 2019] Inter-application vulnerabilities[OPD 2019] Inter-application vulnerabilities
[OPD 2019] Inter-application vulnerabilities
OWASP
 
Integrating Okta with Anypoint Platform for a mobile security use case
Integrating Okta with Anypoint Platform for a mobile security use caseIntegrating Okta with Anypoint Platform for a mobile security use case
Integrating Okta with Anypoint Platform for a mobile security use case
Bahman Kalali
 
What It Takes to Build API Integrations
What It Takes to Build API IntegrationsWhat It Takes to Build API Integrations
What It Takes to Build API Integrations
Nordic APIs
 
Secure Coding: SSL, SOAP, and REST
Secure Coding: SSL, SOAP, and RESTSecure Coding: SSL, SOAP, and REST
Secure Coding: SSL, SOAP, and REST
Salesforce Developers
 
Explorer setting
Explorer settingExplorer setting
Explorer setting
britmaxbackedup3
 
Setting up organization with api access
Setting up organization with api accessSetting up organization with api access
Setting up organization with api access
sivachandra mandalapu
 

Similar to The Most Common Mistakes When Calling Smarty APIs (20)

Overview on ring central errors
Overview on ring central errorsOverview on ring central errors
Overview on ring central errors
 
How to build Simple yet powerful API.pptx
How to build Simple yet powerful API.pptxHow to build Simple yet powerful API.pptx
How to build Simple yet powerful API.pptx
 
OAuth 2.0
OAuth 2.0OAuth 2.0
OAuth 2.0
 
Ch 5: Bypassing Client-Side Controls
Ch 5: Bypassing Client-Side ControlsCh 5: Bypassing Client-Side Controls
Ch 5: Bypassing Client-Side Controls
 
ArcSight Enterprise View REST API Developer's Guide
ArcSight Enterprise View REST API Developer's GuideArcSight Enterprise View REST API Developer's Guide
ArcSight Enterprise View REST API Developer's Guide
 
OAuth SPOP @ IETF 91
OAuth SPOP @ IETF 91OAuth SPOP @ IETF 91
OAuth SPOP @ IETF 91
 
What API Specifications and Tools Help Engineers to Construct a High-Security...
What API Specifications and Tools Help Engineers to Construct a High-Security...What API Specifications and Tools Help Engineers to Construct a High-Security...
What API Specifications and Tools Help Engineers to Construct a High-Security...
 
Build and graduate your app in ring central
Build and graduate your app in ring centralBuild and graduate your app in ring central
Build and graduate your app in ring central
 
Creating a Sign On with Open id connect
Creating a Sign On with Open id connectCreating a Sign On with Open id connect
Creating a Sign On with Open id connect
 
Create custom authentication provider and forget the hassle of managing token...
Create custom authentication provider and forget the hassle of managing token...Create custom authentication provider and forget the hassle of managing token...
Create custom authentication provider and forget the hassle of managing token...
 
Setting up BuzzCity Account - Server Side API
Setting up BuzzCity Account - Server Side APISetting up BuzzCity Account - Server Side API
Setting up BuzzCity Account - Server Side API
 
Big commerce app development
Big commerce app developmentBig commerce app development
Big commerce app development
 
RefCard RESTful API Design
RefCard RESTful API DesignRefCard RESTful API Design
RefCard RESTful API Design
 
RESTful services and OAUTH protocol in IoT
RESTful services and OAUTH protocol in IoTRESTful services and OAUTH protocol in IoT
RESTful services and OAUTH protocol in IoT
 
[OPD 2019] Inter-application vulnerabilities
[OPD 2019] Inter-application vulnerabilities[OPD 2019] Inter-application vulnerabilities
[OPD 2019] Inter-application vulnerabilities
 
Integrating Okta with Anypoint Platform for a mobile security use case
Integrating Okta with Anypoint Platform for a mobile security use caseIntegrating Okta with Anypoint Platform for a mobile security use case
Integrating Okta with Anypoint Platform for a mobile security use case
 
What It Takes to Build API Integrations
What It Takes to Build API IntegrationsWhat It Takes to Build API Integrations
What It Takes to Build API Integrations
 
Secure Coding: SSL, SOAP, and REST
Secure Coding: SSL, SOAP, and RESTSecure Coding: SSL, SOAP, and REST
Secure Coding: SSL, SOAP, and REST
 
Explorer setting
Explorer settingExplorer setting
Explorer setting
 
Setting up organization with api access
Setting up organization with api accessSetting up organization with api access
Setting up organization with api access
 

Recently uploaded

Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan ChartSatta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results
 
Cover Story - China's Investment Leader - Dr. Alyce SU
Cover Story - China's Investment Leader - Dr. Alyce SUCover Story - China's Investment Leader - Dr. Alyce SU
Cover Story - China's Investment Leader - Dr. Alyce SU
msthrill
 
欧洲杯投注-欧洲杯投注外围盘口-欧洲杯投注盘口app|【​网址​🎉ac22.net🎉​】
欧洲杯投注-欧洲杯投注外围盘口-欧洲杯投注盘口app|【​网址​🎉ac22.net🎉​】欧洲杯投注-欧洲杯投注外围盘口-欧洲杯投注盘口app|【​网址​🎉ac22.net🎉​】
欧洲杯投注-欧洲杯投注外围盘口-欧洲杯投注盘口app|【​网址​🎉ac22.net🎉​】
concepsionchomo153
 
Lukas Rycek - GreenChemForCE - project structure.pptx
Lukas Rycek - GreenChemForCE - project structure.pptxLukas Rycek - GreenChemForCE - project structure.pptx
Lukas Rycek - GreenChemForCE - project structure.pptx
pavelborek
 
L'indice de performance des ports à conteneurs de l'année 2023
L'indice de performance des ports à conteneurs de l'année 2023L'indice de performance des ports à conteneurs de l'année 2023
L'indice de performance des ports à conteneurs de l'année 2023
SPATPortToamasina
 
Sustainable Logistics for Cost Reduction_ IPLTech Electric's Eco-Friendly Tra...
Sustainable Logistics for Cost Reduction_ IPLTech Electric's Eco-Friendly Tra...Sustainable Logistics for Cost Reduction_ IPLTech Electric's Eco-Friendly Tra...
Sustainable Logistics for Cost Reduction_ IPLTech Electric's Eco-Friendly Tra...
IPLTech Electric
 
一比一原版(lbs毕业证书)英国伦敦商学院毕业证如何办理
一比一原版(lbs毕业证书)英国伦敦商学院毕业证如何办理一比一原版(lbs毕业证书)英国伦敦商学院毕业证如何办理
一比一原版(lbs毕业证书)英国伦敦商学院毕业证如何办理
eaqmokn
 
Unlocking WhatsApp Marketing with HubSpot: Integrating Messaging into Your Ma...
Unlocking WhatsApp Marketing with HubSpot: Integrating Messaging into Your Ma...Unlocking WhatsApp Marketing with HubSpot: Integrating Messaging into Your Ma...
Unlocking WhatsApp Marketing with HubSpot: Integrating Messaging into Your Ma...
Niswey
 
NewBase 20 June 2024 Energy News issue - 1731 by Khaled Al Awadi_compressed.pdf
NewBase 20 June 2024  Energy News issue - 1731 by Khaled Al Awadi_compressed.pdfNewBase 20 June 2024  Energy News issue - 1731 by Khaled Al Awadi_compressed.pdf
NewBase 20 June 2024 Energy News issue - 1731 by Khaled Al Awadi_compressed.pdf
Khaled Al Awadi
 
Easy Earnings Through Refer and Earn Apps Without KYC.pptx
Easy Earnings Through Refer and Earn Apps Without KYC.pptxEasy Earnings Through Refer and Earn Apps Without KYC.pptx
Easy Earnings Through Refer and Earn Apps Without KYC.pptx
Fx Lotus
 
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan ChartSatta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results
 
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan ChartSatta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results
 
2024.06 CPMN Cambridge - Beyond Now-Next-Later.pdf
2024.06 CPMN Cambridge - Beyond Now-Next-Later.pdf2024.06 CPMN Cambridge - Beyond Now-Next-Later.pdf
2024.06 CPMN Cambridge - Beyond Now-Next-Later.pdf
Cambridge Product Management Network
 
Truck Loading Conveyor Manufacturers Chennai
Truck Loading Conveyor Manufacturers ChennaiTruck Loading Conveyor Manufacturers Chennai
Truck Loading Conveyor Manufacturers Chennai
ConveyorSystem
 
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan ChartSatta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results
 
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan ChartSatta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results
 
Adani Group Requests For Additional Land For Its Dharavi Redevelopment Projec...
Adani Group Requests For Additional Land For Its Dharavi Redevelopment Projec...Adani Group Requests For Additional Land For Its Dharavi Redevelopment Projec...
Adani Group Requests For Additional Land For Its Dharavi Redevelopment Projec...
Adani case
 
Science Around Us Module 2 Matter Around Us
Science Around Us Module 2 Matter Around UsScience Around Us Module 2 Matter Around Us
Science Around Us Module 2 Matter Around Us
PennapaKeavsiri
 
Enabling Digital Sustainability by Jutta Eckstein
Enabling Digital Sustainability by Jutta EcksteinEnabling Digital Sustainability by Jutta Eckstein
Enabling Digital Sustainability by Jutta Eckstein
Jutta Eckstein
 
Discover the Beauty and Functionality of The Expert Remodeling Service
Discover the Beauty and Functionality of The Expert Remodeling ServiceDiscover the Beauty and Functionality of The Expert Remodeling Service
Discover the Beauty and Functionality of The Expert Remodeling Service
obriengroupinc04
 

Recently uploaded (20)

Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan ChartSatta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
 
Cover Story - China's Investment Leader - Dr. Alyce SU
Cover Story - China's Investment Leader - Dr. Alyce SUCover Story - China's Investment Leader - Dr. Alyce SU
Cover Story - China's Investment Leader - Dr. Alyce SU
 
欧洲杯投注-欧洲杯投注外围盘口-欧洲杯投注盘口app|【​网址​🎉ac22.net🎉​】
欧洲杯投注-欧洲杯投注外围盘口-欧洲杯投注盘口app|【​网址​🎉ac22.net🎉​】欧洲杯投注-欧洲杯投注外围盘口-欧洲杯投注盘口app|【​网址​🎉ac22.net🎉​】
欧洲杯投注-欧洲杯投注外围盘口-欧洲杯投注盘口app|【​网址​🎉ac22.net🎉​】
 
Lukas Rycek - GreenChemForCE - project structure.pptx
Lukas Rycek - GreenChemForCE - project structure.pptxLukas Rycek - GreenChemForCE - project structure.pptx
Lukas Rycek - GreenChemForCE - project structure.pptx
 
L'indice de performance des ports à conteneurs de l'année 2023
L'indice de performance des ports à conteneurs de l'année 2023L'indice de performance des ports à conteneurs de l'année 2023
L'indice de performance des ports à conteneurs de l'année 2023
 
Sustainable Logistics for Cost Reduction_ IPLTech Electric's Eco-Friendly Tra...
Sustainable Logistics for Cost Reduction_ IPLTech Electric's Eco-Friendly Tra...Sustainable Logistics for Cost Reduction_ IPLTech Electric's Eco-Friendly Tra...
Sustainable Logistics for Cost Reduction_ IPLTech Electric's Eco-Friendly Tra...
 
一比一原版(lbs毕业证书)英国伦敦商学院毕业证如何办理
一比一原版(lbs毕业证书)英国伦敦商学院毕业证如何办理一比一原版(lbs毕业证书)英国伦敦商学院毕业证如何办理
一比一原版(lbs毕业证书)英国伦敦商学院毕业证如何办理
 
Unlocking WhatsApp Marketing with HubSpot: Integrating Messaging into Your Ma...
Unlocking WhatsApp Marketing with HubSpot: Integrating Messaging into Your Ma...Unlocking WhatsApp Marketing with HubSpot: Integrating Messaging into Your Ma...
Unlocking WhatsApp Marketing with HubSpot: Integrating Messaging into Your Ma...
 
NewBase 20 June 2024 Energy News issue - 1731 by Khaled Al Awadi_compressed.pdf
NewBase 20 June 2024  Energy News issue - 1731 by Khaled Al Awadi_compressed.pdfNewBase 20 June 2024  Energy News issue - 1731 by Khaled Al Awadi_compressed.pdf
NewBase 20 June 2024 Energy News issue - 1731 by Khaled Al Awadi_compressed.pdf
 
Easy Earnings Through Refer and Earn Apps Without KYC.pptx
Easy Earnings Through Refer and Earn Apps Without KYC.pptxEasy Earnings Through Refer and Earn Apps Without KYC.pptx
Easy Earnings Through Refer and Earn Apps Without KYC.pptx
 
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan ChartSatta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
 
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan ChartSatta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
 
2024.06 CPMN Cambridge - Beyond Now-Next-Later.pdf
2024.06 CPMN Cambridge - Beyond Now-Next-Later.pdf2024.06 CPMN Cambridge - Beyond Now-Next-Later.pdf
2024.06 CPMN Cambridge - Beyond Now-Next-Later.pdf
 
Truck Loading Conveyor Manufacturers Chennai
Truck Loading Conveyor Manufacturers ChennaiTruck Loading Conveyor Manufacturers Chennai
Truck Loading Conveyor Manufacturers Chennai
 
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan ChartSatta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
 
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan ChartSatta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
 
Adani Group Requests For Additional Land For Its Dharavi Redevelopment Projec...
Adani Group Requests For Additional Land For Its Dharavi Redevelopment Projec...Adani Group Requests For Additional Land For Its Dharavi Redevelopment Projec...
Adani Group Requests For Additional Land For Its Dharavi Redevelopment Projec...
 
Science Around Us Module 2 Matter Around Us
Science Around Us Module 2 Matter Around UsScience Around Us Module 2 Matter Around Us
Science Around Us Module 2 Matter Around Us
 
Enabling Digital Sustainability by Jutta Eckstein
Enabling Digital Sustainability by Jutta EcksteinEnabling Digital Sustainability by Jutta Eckstein
Enabling Digital Sustainability by Jutta Eckstein
 
Discover the Beauty and Functionality of The Expert Remodeling Service
Discover the Beauty and Functionality of The Expert Remodeling ServiceDiscover the Beauty and Functionality of The Expert Remodeling Service
Discover the Beauty and Functionality of The Expert Remodeling Service
 

The Most Common Mistakes When Calling Smarty APIs

  • 1. Common Mistakes When Calling Smarty APIs Status Codes 401 and 402
  • 2. In today’s webinar, we’ll cover two types of mistakes: “Authentication Required” errors — status code 401 “Payment Required” errors — status code 402
  • 3. “Authentication Required” Errors — Status Code 401 In this section: ● How to authenticate API requests the right way ● Common mistakes in client-side requests ● Common mistakes in server-side requests
  • 4. How to Authenticate API Requests the Right Way 1. Get familiar with your account's API Keys page.
  • 5.
  • 6. How to Authenticate API Requests the Right Way 1. Get familiar with your account's API Keys page. 2. Understand the difference between client-side requests (in a web browser) and server-side requests. Since browsers send a Referer header automatically, our system treats any request that includes a Referer header as a client-side request. In contrast, if the request does NOT have a Referer header, our system treats it is a server-side request.
  • 7.
  • 8. How to Authenticate API Requests the Right Way 1. Get familiar with your account's API Keys page. 2. Understand the difference between client-side requests (in a web browser) and server-side requests. Since browsers send a Referer header automatically, our system treats any request that includes a Referer header as a client-side request. In contrast, if the request does NOT have that header, our system treats it is a server-side request. 3. For client-side calls: ● Include an embedded key in the request URL: key=31050191824945 ● Make sure that the Referer value sent by the browser is listed as a host for the embedded key being used.
  • 9. How to Authenticate API Requests the Right Way 1. Get familiar with your account's API Keys page. 2. Understand the difference between client-side requests (in a web browser) and server-side requests. Since browsers send a Referer header automatically, our system treats any request that includes a Referer header as a client-side request. In contrast, if the request does NOT have that header, our system treats it is a server-side request. 3. For client-side calls: ● Include an embedded key in the request URL: key=31050191824945 ● Make sure that the Referer value sent by the browser is listed as a host for the embedded key being used. 1. For server-side calls: ● Include the secret keys (auth-id and auth-token) in the request URL: auth- id=a1Gf2rC&auth-token=HH3tnV
  • 10. Common Mistakes in Client-Side Requests ● Don't submit secret keys in a client-side request.
  • 11. Common Mistakes in Client-Side Requests ● Don't submit secret keys in a client-side request. ● Don't list the wrong referer/host value with the embedded key. (Look between the slashes of the referer value.)
  • 12. Common Mistakes in Client-Side Requests ● Don't submit secret keys in a client-side request. ● Don't list the wrong referer/host value with the embedded key. (Look between the slashes of the referer value.) ○ For localhost, just list "localhost" without the port number. ○ For calls from the jsfiddle website, the correct host is fiddle.jshell.net
  • 13. Common Mistakes in Client-Side Requests ● Don't submit secret keys in a client-side request. ● Don't list the wrong referer/host value with the embedded key. (Look between the slashes of the referer value.) ○ For localhost, just list "localhost" without the port number. ○ For calls from the jsfiddle website, the correct host is fiddle.jshell.net ● When using a wildcard in a hostname, don't use the * for more than one level of subdomain. For example: complete referer value: www.accounts.smarty.com correct: *.accounts.smarty.com incorrect: *.smarty.com
  • 14. Common Mistakes in Client-Side Requests ● Don't submit secret keys in a client-side request. ● Don't list the wrong referer/host value with the embedded key. (Look between the slashes of the referer value.) ○ For localhost, just list "localhost" without the port number. ○ For calls from the jsfiddle website, the correct host is fiddle.jshell.net ● When using a wildcard in a hostname, don't use the * for more than one level of subdomain. ● Don't forget to explicitly set up a Referer header when calling from a mobile app or when using an embedded key in Postman. (Mobile apps and Postman don't send a Referer header by default, so you will need to set one up manually.)
  • 15. Common Mistakes in Client-Side Requests ● Don't submit secret keys in a client-side request. ● Don't list the wrong referer/host value with the embedded key. (Look between the slashes of the referer value.) ○ For localhost, just list "localhost" without the port number. ○ For calls from the jsfiddle website, the correct host is fiddle.jshell.net ● When using a wildcard in a hostname, don't use the * for more than one level of subdomain. ● Don't forget to explicitly set up a Referer header when calling from a mobile app or when using an embedded key in Postman. (Mobile apps and Postman don't send a Referer header by default, so you will need to set one up manually.) ● Don't forget to URL-encode the request URL. For example, a # symbol that is not URL- encoded will break up the request URL, and our system will not recognize any part of the URL after the # symbol.
  • 16. Common Mistakes in Server-Side Requests ● Don't send an embedded key in a server-side request.
  • 17. Common Mistakes in Server-Side Requests ● Don't send an embedded key in a server-side request. ● Don't type the auth-id or auth-token by hand; you might mistype a 1 for a lower-case l or a 0 for a capital O.
  • 18. Common Mistakes in Server-Side Requests ● Don't send an embedded key in a server-side request. ● Don't type the auth-id or auth-token by hand; you might mistype a 1 for a lower-case l or a 0 for a capital O. ● Don't forget to URL-encode the request URL.
  • 19. “Payment Required” Errors — Status Code 402 In this section: ● Understanding your Smarty account and your licenses ● Common mistakes that result in a "Payment Required" error
  • 20. Understanding Your Smarty Account and Your Licenses ● If you are a developer trying to work with the Smarty APIs, we recommend that you be able to log in to the Smarty account you are trying to use. Currently, each Smarty account has only a single login email and password, so you would need to obtain those login details from whomever has them.
  • 21. Understanding Your Smarty Account and Your Licenses ● If you are a developer trying to work with the Smarty APIs, we recommend that you be able to log in to the Smarty account you are trying to use. Currently, each Smarty account has only a single login email and password, so you would need to obtain those login details from whomever has them. ● Be familiar with the different pages available in your account, especially the Subscriptions and API Keys pages.
  • 22. Understanding Your Smarty Account and Your Licenses ● If you are a developer trying to work with the Smarty APIs, we recommend that you be able to log in to the Smarty account you are trying to use. Currently, each Smarty account has only a single login email and password, so you would need to obtain those login details from whomever has them. ● Be familiar with the different pages available in your account, especially the Subscriptions and API Keys pages. ● Make sure you understand your licenses. Know which APIs they allow you to call and what specific abilities are included. Because we offer so many different licenses, distinguishing them can be tricky. Feel free to ask the Support team or your sales rep about the abilities of any particular license.
  • 23. Common Mistakes That Result in a Payment Required Error ● Don't use API keys from the wrong account. Many companies have multiple Smarty accounts — for example, a production account and several accounts used by individual developers. Make sure the auth credentials you are submitting in the request URL pertain to the account that actually has the right subscription in it.
  • 24. Common Mistakes That Result in a Payment Required Error ● Don't use API keys from the wrong account. ● Don't try to call an API that is not supported by one of your licenses. Example: You try to call the US Autocomplete Pro API, but you only have a US Address Verification subscription, with a US Core Edition license. (Our US Autocomplete service requires its own license.)
  • 25. Common Mistakes That Result in a Payment Required Error ● Don't use API keys from the wrong account. ● Don't try to call an API that is not supported by one of your licenses. ● If using one of our SDKs, don't assume that the license value listed in the Github example code is the right one. Example: The default license listed in the Github example code is us- rooftop-geocoding-cloud, but you don't actually have a Rooftop Geocoding license. You may need to change the license value to us-core-cloud or us-standard-cloud. This line is from the JavaScript SDK: let clientBuilder = new SmartyCore.ClientBuilder(credentials) .withBaseUrl("YOUR URL").withLicenses(["us-rooftop-geocoding-cloud"]);
  • 26. Common Mistakes That Result in a Payment Required Error ● Don't use API keys from the wrong account. ● Don't try to call an API that is not supported by one of your licenses. ● If using one of our SDKs, don't assume that the license value listed in the Github example code is the right one. ● Don't try to use an ability that doesn't pertain to your specific license. Examples: ○ When calling our US Street Address API, you include match=enhanced, but you don't have a US Core Edition license. You only have the older US Standard Edition license (which doesn’t include enhanced matching).
  • 27. Common Mistakes That Result in a Payment Required Error ● Don't use API keys from the wrong account. ● Don't try to call an API that is not supported by one of your licenses. ● If using one of our SDKs, don't assume that the license value listed in the Github example code is the right one. ● Don't try to use an ability that doesn't pertain to your specific license. Examples: ○ When calling our US Street Address API, you include match=enhanced, but you don't have a US Core Edition license. You only have the older US Standard Edition license (which doesn’t include enhanced matching). ○ When calling our International Street API, you include geocode=true, but your license is an International Global Basic license that doesn't include geocodes.
  • 28. Common Mistakes That Result in a Payment Required Error ● Don't use API keys from the wrong account. ● Don't try to call an API that is not supported by one of your licenses. ● If using one of our SDKs, don't assume that the license value listed in the Github example code is the right one. ● Don't try to use an ability that doesn't pertain to your specific license. Examples: ○ When calling our US Street Address API, you include match=enhanced, but you don't have a US Core Edition license. You only have the older US Standard Edition license (which doesn’t include enhanced matching). ○ When calling our International Street API, you include geocode=true, but your license is an International Global Basic license that doesn't include geocodes. ○ When calling our International Street API, you submit an address from a country not included with your particular license.
  • 29. Finishing Up The Smarty Support team is here for you. We pride ourselves on being super responsive. Our regular hours are weekdays 8 to 5 Mountain Time. Phone: 801-877-5778 Chat: smarty.com Email: support@smarty.com
  • 30. Try our APIs for free! smarty.com/signup