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

  Рет қаралды 24,460

ServiceNow Dev Program

ServiceNow Dev Program

Күн бұрын

Пікірлер: 29
@kaila2880
@kaila2880 2 жыл бұрын
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 жыл бұрын
Thank you for the HUGE contribution to everyone attempting to learn this massive application! So helpful, informative and easy to follow.
@ChuckTomasi
@ChuckTomasi 5 жыл бұрын
You are very welcome Will. Thanks for watching!
@jerryjohn257
@jerryjohn257 4 жыл бұрын
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.
@anilkumarmohanty2077
@anilkumarmohanty2077 3 жыл бұрын
Excellent one Chuck...Very well explained
@bernarda.moralesnicola7799
@bernarda.moralesnicola7799 4 жыл бұрын
Very "FUN" video. Thanks !!!
@devs0810
@devs0810 5 жыл бұрын
Thanks Chuck.. The entire tutorial is pure Gold..
@amirmohamed4670
@amirmohamed4670 Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
@@ChuckTomasi ​Oh my bad. Thank you for the clarification. I really appreciate your efforts.
@karuna128
@karuna128 5 жыл бұрын
very well done chuck. Appreciate your effort
@ChuckTomasi
@ChuckTomasi 5 жыл бұрын
Thank you!
@SoorajSinghBaghel
@SoorajSinghBaghel 5 жыл бұрын
Thanks a lot Chuck
@ChuckTomasi
@ChuckTomasi 5 жыл бұрын
You are welcome.
@jjp5619
@jjp5619 5 жыл бұрын
Very helpful. I have been looking for something like this!!
@ChuckTomasi
@ChuckTomasi 5 жыл бұрын
Thank you. I'm glad you found it useful
@Freak512
@Freak512 Жыл бұрын
I didn’t understood what is queryparms
@meryemLux
@meryemLux 4 жыл бұрын
Very informative! Thanks^^
@ChuckTomasi
@ChuckTomasi 4 жыл бұрын
You are welcome. Thank you 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?
@sttpt
@sttpt 4 жыл бұрын
Very helpful...Thanks....
@ChuckTomasi
@ChuckTomasi 4 жыл бұрын
You are very welcome. Thanks for watching.
@HumaAzIman
@HumaAzIman 3 жыл бұрын
Very Helpful.
@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?
Learn JavaScript on the Now Platform: Lab 8a - Build a scripted REST API
0:47
ServiceNow Dev Program
Рет қаралды 7 М.
Learn JavaScript on the Now Platform: Helpful resources
8:15
ServiceNow Dev Program
Рет қаралды 8 М.
Cheerleader Transformation That Left Everyone Speechless! #shorts
00:27
Fabiosa Best Lifehacks
Рет қаралды 15 МЛН
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 43 МЛН
Part 3 of Dish Network 500 Testing: Peaking the Dish
18:11
That Dish500_guy18
Рет қаралды 22
Transform Maps - Learn Integrations on the Now Platform
8:52
ServiceNow Dev Program
Рет қаралды 17 М.
Learn JavaScript on the Now Platform: Lesson 30 - JSON Stringify and Parse
6:32
ServiceNow Dev Program
Рет қаралды 15 М.
What is a REST API?
9:12
IBM Technology
Рет қаралды 1,6 МЛН
Deep Dive into REST API Design and Implementation Best Practices
12:02
Software Developer Diaries
Рет қаралды 65 М.
SN Utils with Arnoud Kooi - Did You Know
23:41
ServiceNow Dev Program
Рет қаралды 16 М.
#7 ServiceNow Developer Training | Debug Client Scripts
31:21
SAASWITHSERVICENOW
Рет қаралды 25 М.
ServiceNow Scripted REST APIs: Part 18 - Authentication Scopes
13:39
Secretary of Simplification
Рет қаралды 3 М.