Learn JavaScript on the Now Platform: Lesson 36 - Scripted REST APIs

Поделиться
HTML-код
  • Опубликовано: 26 дек 2024

Комментарии •

  • @kaila2880
    @kaila2880 2 года назад +1

    wanna see all scripts? :)
    Script 1 4:42 GET (Hello world)
    Script 2 7:27 GET (query params)
    Script 3 11:25 GET (path params)
    Script 4 14:35 POST (request body payload)
    Script 5 18:25 POST (request body payload + response body payload)
    btw - thanks Chuck, great work!

  • @williammadisondavis
    @williammadisondavis 5 лет назад +4

    Thank you for the HUGE contribution to everyone attempting to learn this massive application! So helpful, informative and easy to follow.

    • @ChuckTomasi
      @ChuckTomasi 5 лет назад +1

      You are very welcome Will. Thanks for watching!

  • @jerryjohn257
    @jerryjohn257 4 года назад +1

    Chuck I like the way you present the content . You are an exceptional talent . GOD BLESS

    • @ChuckTomasi
      @ChuckTomasi 4 года назад

      Thank you J J. I'm glad you enjoyed it.

  • @devs0810
    @devs0810 5 лет назад +1

    Thanks Chuck..
    The entire tutorial is pure Gold..

  • @anilkumarmohanty2077
    @anilkumarmohanty2077 3 года назад

    Excellent one Chuck...Very well explained

  • @karuna128
    @karuna128 5 лет назад +2

    very well done chuck. Appreciate your effort

  • @amirmohamed4670
    @amirmohamed4670 Год назад +2

    Hi Chuck,
    Many thanks for your effort.
    I have a question.
    Why did we use here the dot notation method instead of getValue that you suggested that it's the best way to get the value of a record ?
    var isActiveQuery = queryParams.getValue("active");

    • @ChuckTomasi
      @ChuckTomasi Год назад +1

      Excellent question. getValue() is a method available to GlideRecord objects. queryParams is not a GlideRecord, therefore we cannot use getValue(). If you try it, you'll get an error stating that the system doesn't know what getValue() is.

    • @amirmohamed4670
      @amirmohamed4670 Год назад +1

      @@ChuckTomasi ​Oh my bad. Thank you for the clarification. I really appreciate your efforts.

  • @bernarda.moralesnicola7799
    @bernarda.moralesnicola7799 4 года назад +1

    Very "FUN" video. Thanks !!!

  • @Freak512
    @Freak512 Год назад +1

    I didn’t understood what is queryparms

  • @jjp5619
    @jjp5619 5 лет назад +1

    Very helpful. I have been looking for something like this!!

    • @ChuckTomasi
      @ChuckTomasi 5 лет назад

      Thank you. I'm glad you found it useful

  • @SoorajSinghBaghel
    @SoorajSinghBaghel 5 лет назад +2

    Thanks a lot Chuck

  • @meryemLux
    @meryemLux 4 года назад +1

    Very informative! Thanks^^

    • @ChuckTomasi
      @ChuckTomasi 4 года назад

      You are welcome. Thank you for watching.

  • @HumaAzIman
    @HumaAzIman 4 года назад

    Very Helpful.

  • @sttpt
    @sttpt 5 лет назад +1

    Very helpful...Thanks....

    • @ChuckTomasi
      @ChuckTomasi 5 лет назад

      You are very welcome. Thanks for watching.

  • @Hash10304
    @Hash10304 4 года назад

    is it any standard to use "body.data" for defining POST variables? and queryParams = request.queryParams; GET method variables. why we are defining them in different way

    • @ChuckTomasi
      @ChuckTomasi 4 года назад

      While I don't have a definitive answer from the product managers, my inner developer says "path parameters and query parameters are both part of the URI, so the similarity there makes sense. You have simple key=value pairs for each. POST methods have a body that can be a complex object such as an array of objects. These are addressed as request.body, with the payload of the request body in the data object to handle these more complex data types." Just out of curiosity, if you were to create it, what would you have done?

  • @detlefbiedermann7174
    @detlefbiedermann7174 4 года назад

    Hello, great tutorial, many thanks, one question: script 5 does not change the result when I:
    var answer = {};
    answer.status = "OK";
    answer.author = "system";
    answer.item = {"name" : "Rome", "owner" : "Chuck Tomasi", "count" : 12};
    answer.active = true;
    //response.setBody(answer);
    //return response;
    return answer;
    So the "setBody()" command seams not to be necessary ?

    • @ChuckTomasi
      @ChuckTomasi 4 года назад

      I have found that using response.setBody() makes it easier to read later "Hey, this is the object I am sending back". returning an objection is implicit and possibly confusing. Additionally, best practice suggests using getters and setters to avoid inferred things happening or missing things that the API can provide.

  • @janakiramanss6214
    @janakiramanss6214 5 лет назад

    Hey how to call a external api inside Ajax call

    • @ChuckTomasi
      @ChuckTomasi 5 лет назад

      Can you give me some specifics of what you are trying to do?