Weather APIs Integration | Named Credentials & External Credentials in

  Рет қаралды 12,055

Salesforce Bolt

Salesforce Bolt

Күн бұрын

In this video I will show you an API integration using a third party Weather APIs. I will create a Lightning Web Component and show you the weather based on the selected city.
Also I will show you how you can use Named Credentials & External Credentials.
#api #LWC #salesforce
Join me on Instagram : / iamkapilbatra
My journey : www.salesforce...
Blog : www.salesforce...
Website : www.salesforce...​​
LinkedIn : / salesforcebolt
Twitter : / salesforcebolt​​
Facebook : / iamsalesforcebolt

Пікірлер: 35
@amrutninawe3154
@amrutninawe3154 Жыл бұрын
Awesome content for Integration learners... Thankyou
@SalesforceBolt
@SalesforceBolt Жыл бұрын
Glad you like it!
@adwit511
@adwit511 Жыл бұрын
The best channel for sfdc newbies!!
@SalesforceBolt
@SalesforceBolt Жыл бұрын
Thanks Adwit, glad you like it.
@dnyaneshwarkakad5191
@dnyaneshwarkakad5191 Жыл бұрын
Just Awesome content 👍👍
@SalesforceBolt
@SalesforceBolt Жыл бұрын
Thanks for the visit
@ravindrasutar5041
@ravindrasutar5041 Жыл бұрын
Helpful Thanks
@SalesforceBolt
@SalesforceBolt Жыл бұрын
Glad you like it,
@chandu5645
@chandu5645 Жыл бұрын
Very informative. Can you please also a make a complete video on Named credentials with OAuth 2.0. It's really confusing 😟
@SalesforceBolt
@SalesforceBolt Жыл бұрын
Yes it is confusing, I am planning a separate video as well!
@Adrift98
@Adrift98 10 ай бұрын
​@@SalesforceBoltis the video out?
@ghoshdipan
@ghoshdipan Ай бұрын
@@SalesforceBolt Is the video out now???
@SubhasiniVM
@SubhasiniVM Жыл бұрын
Thanks for the good video. Please share video a beginner how to start working in integration
@SalesforceBolt
@SalesforceBolt Жыл бұрын
Sure I will add itin queue.
@kishoreveeran383
@kishoreveeran383 Жыл бұрын
Appreciate you work helpful for me , i have request one video about lightning datatable. in datatable how to apply type attribute so the values comes as same sized button irrespect of length looking forward for that videos
@SalesforceBolt
@SalesforceBolt Жыл бұрын
Sure, I will add it in the queue.
@yatin1370
@yatin1370 7 ай бұрын
Precise and to the point. Wonderful tutorial to exercise LWC and Integration topics at the same time. Just an observation: If we don't give anything in input and press the button we still get 'Sunny' climate. I verified this a lot of times. To fix this, I rephrased the apex method as follows and now it gives error when nothing is given in input and still weather is searched: public static string getWeather(String city){ if (city != null) { Http http = new Http(); HttpRequest request = new HttpRequest(); request.setEndpoint('callout:WeatherAPI/current.json?q='+city); request.setMethod('GET'); HttpResponse response = http.send(request); if (response.getStatusCode() == 200) { return response.getBody(); } } return ''; EDIT 2: I also fixed searching weather for cities where there are two words...for eg: "New York" or "Los Angeles" which does not work with current code. I used regex for this in Javascript. I added a property 'encodedInputText' in the JS file and also tweaked the buttonClick function as below: buttonClick(event){ //REGEX for considering the spaces given in the input and spaces in City Name const input = this.template.querySelector("lightning-input").value; const regex = / {2,}/g; const correctedInput = input.replaceAll(regex, " ").trim(); this.encodedInputText = encodeURI(correctedInput); getWeather({city : this.encodedInputText}) .then((response)=>{ console.log("in then"); //parse received JSON let parsedData = JSON.parse(response); >>>> Rest is same >>>>>
@SalesforceBolt
@SalesforceBolt 7 ай бұрын
Thanks, glad you like it!
@ikec7941
@ikec7941 Жыл бұрын
If your hardcoding key into custom header, principal becomes redundant since it's meant to refered using merge field syntax in custom header value to hide secrets.
@SalesforceBolt
@SalesforceBolt Жыл бұрын
Thanks for noticing it. Yes I agree, I missed it in video but added it in the blog post for the same. www.salesforcebolt.com/2023/07/weather-apis-integration-named.html
@ikec7941
@ikec7941 Жыл бұрын
Great 👍 Thanks
@ujjwalsharma3285
@ujjwalsharma3285 Жыл бұрын
Hi, Great stuff! If possible can you create or suggest series on salesforce integration? Videos on youtube are little confusing and don't implement end to end. Most of the videos just demo using postman.
@SalesforceBolt
@SalesforceBolt Жыл бұрын
Sure I will add it in the queue!
@Shaik_Abdul_01
@Shaik_Abdul_01 6 ай бұрын
Hi @Salesforce Bolt, Thanks a million for sharing useful Content. Iam encountering an error "API Key is disabled ", Could u pls guide me How to resolve it.
@SalesforceBolt
@SalesforceBolt 6 ай бұрын
Hi are you still having the same issue?
@dattasoham
@dattasoham 6 ай бұрын
Opencage API is not working using Named Credential and External Credential
@SalesforceBolt
@SalesforceBolt 6 ай бұрын
What's the error in the console?
@TK-vt3ep
@TK-vt3ep 9 ай бұрын
How do certification works here?
@SalesforceBolt
@SalesforceBolt 9 ай бұрын
Can you please elaborate your questions?
@TK-vt3ep
@TK-vt3ep 9 ай бұрын
@@SalesforceBolt so i have to use https end point to generate token which i will use as bearer authorization for subsequent callout of api’s. Now i am configuring named credential with external credential but then it keeps giving me 503 error, later on it was brought up that the cert i have in named credential should be client cert. So how do i use that now? The api team gave the cert but how do i use for my named credential? I know i have to import it under certifications but do i need to make changes in my apex code too for using that cert?
@anupambasak2000
@anupambasak2000 9 ай бұрын
Error: System.NullPointerException: Attempt to de-reference a null object Error: Class.Weather.getWeather: line 28, column 1 AnonymousBlock: line 1, column 1 AnonymousBlock: line 1, column 1 59.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO Execute Anonymous: Weather.getWeather('London'); Why is this error coming?
@SalesforceBolt
@SalesforceBolt 9 ай бұрын
Have you copied the exact code from code snippet?
@anupambasak2000
@anupambasak2000 8 ай бұрын
Hi@@SalesforceBolt! Previously it worked for me... I fetched data also... But today I tried again but it is showing me ------ response: {"error":{"code":1002,"message":"API key is invalid or not provided."}}
@SalesforceBolt
@SalesforceBolt 8 ай бұрын
@@anupambasak2000 please check the key if it got expired.
@anupambasak2000
@anupambasak2000 8 ай бұрын
@@SalesforceBolt It wasn't expired... My bad I used other name in Custom Headers... Later it worked... But could you try using OpenWeatherMap API and NewsAPI with External Named Credentials? I was integrating these but it was not working... Finally I did using Custom Metadata but how to do with External Credentials, I'm still desperate to know...
Nastya and balloon challenge
00:23
Nastya
Рет қаралды 53 МЛН
He bought this so I can drive too🥹😭 #tiktok #elsarca
00:22
Elsa Arca
Рет қаралды 58 МЛН
Senior Angular Developer Interview (theory)
41:57
WeCoded
Рет қаралды 20 М.
Salesforce API Authentication and Authorization Step By Step
18:30
Cloud Developer
Рет қаралды 28 М.
Common Salesforce Integration Scenarios and Solutions
34:39
Salesforce Apex Hours
Рет қаралды 22 М.
Want to build a good API? Here's 5 Tips for API Design.
10:57
CodeOpinion
Рет қаралды 205 М.
How to Integrate with No code! - Salesforce HTTP Callouts in Flow
26:26
Deep dive into Salesforce Named Credential
57:21
Salesforce Codex
Рет қаралды 8 М.
Apex Callouts with Improved Named Credentials | Mini Hacks Solved | Season 02
25:30