Weather APIs Integration | Named Credentials & External Credentials in

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ธ.ค. 2024

ความคิดเห็น • 43

  • @amrutninawe3154
    @amrutninawe3154 ปีที่แล้ว +2

    Awesome content for Integration learners...
    Thankyou

  • @dnyaneshwarkakad5191
    @dnyaneshwarkakad5191 ปีที่แล้ว +2

    Just Awesome content 👍👍

  • @adwit511
    @adwit511 ปีที่แล้ว +2

    The best channel for sfdc newbies!!

  • @ravindrasutar5041
    @ravindrasutar5041 ปีที่แล้ว +1

    Helpful
    Thanks

  • @SubhasiniVM
    @SubhasiniVM ปีที่แล้ว +1

    Thanks for the good video. Please share video a beginner how to start working in integration

  • @ikec7941
    @ikec7941 ปีที่แล้ว +5

    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  ปีที่แล้ว +1

      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

  • @chandu5645
    @chandu5645 ปีที่แล้ว +4

    Very informative. Can you please also a make a complete video on Named credentials with OAuth 2.0. It's really confusing 😟

    • @SalesforceBolt
      @SalesforceBolt  ปีที่แล้ว +1

      Yes it is confusing, I am planning a separate video as well!

    • @Adrift98
      @Adrift98 ปีที่แล้ว

      ​@@SalesforceBoltis the video out?

    • @ghoshdipan
      @ghoshdipan 3 หลายเดือนก่อน

      @@SalesforceBolt Is the video out now???

  • @yatin1370
    @yatin1370 10 หลายเดือนก่อน +1

    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  10 หลายเดือนก่อน

      Thanks, glad you like it!

  • @ChandraYetukuri-v4w
    @ChandraYetukuri-v4w 14 วันที่ผ่านมา

    Hi Kapil, the video is very informative. Could you please let us know how the same can be re authorized using OAuth 2.0 instead of custom.

  • @kishoreveeran383
    @kishoreveeran383 ปีที่แล้ว +2

    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

  • @ujjwalsharma3285
    @ujjwalsharma3285 ปีที่แล้ว +1

    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.

  • @ChandraYetukuri-v4w
    @ChandraYetukuri-v4w 14 วันที่ผ่านมา

    @Salesforce Bolt I just tried this in my org. It gives an error if the city has two words. For New York, Abu Dhabi are giving error. Single word cities are fine.

  • @premnaathNJ
    @premnaathNJ 2 หลายเดือนก่อน +1

    i subcribed today, to search any datacloud integgration, is it possible?

    • @SalesforceBolt
      @SalesforceBolt  2 หลายเดือนก่อน

      Thanks for the subscribe. Data Cloud integrations will be coming soon.

  • @Shaik_Abdul_01
    @Shaik_Abdul_01 9 หลายเดือนก่อน +1

    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  9 หลายเดือนก่อน

      Hi are you still having the same issue?

    • @ChandraYetukuri-v4w
      @ChandraYetukuri-v4w 14 วันที่ผ่านมา

      @@SalesforceBolt @Shaik_Abdul_01 it could be because the API key would have expired. Its only valid for few weeks i guess..

  • @leosalles5338
    @leosalles5338 24 วันที่ผ่านมา

    i dont know why, but my icon doesn't load...but if i open the image in a new tab, i can see it.

    • @SalesforceBolt
      @SalesforceBolt  22 วันที่ผ่านมา

      Is it coming from the same URL that you must have added in your named credentials?

  • @dattasoham
    @dattasoham 9 หลายเดือนก่อน +1

    Opencage API is not working using Named Credential and External Credential

    • @SalesforceBolt
      @SalesforceBolt  9 หลายเดือนก่อน

      What's the error in the console?

  • @TK-vt3ep
    @TK-vt3ep 11 หลายเดือนก่อน

    How do certification works here?

    • @SalesforceBolt
      @SalesforceBolt  11 หลายเดือนก่อน

      Can you please elaborate your questions?

    • @TK-vt3ep
      @TK-vt3ep 11 หลายเดือนก่อน

      @@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?

  • @ChandraYetukuri-v4w
    @ChandraYetukuri-v4w 14 วันที่ผ่านมา

    The error was rectified by changing the code as below....
    String encodedCity = EncodingUtil.urlEncode(city, 'UTF-8');
    req.setEndPoint('callout:WeatherAPI/current.json?q='+encodedCity);

  • @anupambasak2000
    @anupambasak2000 11 หลายเดือนก่อน +1

    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  11 หลายเดือนก่อน

      Have you copied the exact code from code snippet?

    • @anupambasak2000
      @anupambasak2000 11 หลายเดือนก่อน +1

      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  10 หลายเดือนก่อน

      @@anupambasak2000 please check the key if it got expired.

    • @anupambasak2000
      @anupambasak2000 10 หลายเดือนก่อน

      @@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...