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!
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");
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.
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
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?
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 ?
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.
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!
Thank you for the HUGE contribution to everyone attempting to learn this massive application! So helpful, informative and easy to follow.
You are very welcome Will. Thanks for watching!
Chuck I like the way you present the content . You are an exceptional talent . GOD BLESS
Thank you J J. I'm glad you enjoyed it.
Thanks Chuck..
The entire tutorial is pure Gold..
Excellent one Chuck...Very well explained
very well done chuck. Appreciate your effort
Thank you!
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");
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.
@@ChuckTomasi Oh my bad. Thank you for the clarification. I really appreciate your efforts.
Very "FUN" video. Thanks !!!
I didn’t understood what is queryparms
Very helpful. I have been looking for something like this!!
Thank you. I'm glad you found it useful
Thanks a lot Chuck
You are welcome.
Very informative! Thanks^^
You are welcome. Thank you for watching.
Very Helpful.
Very helpful...Thanks....
You are very welcome. Thanks for watching.
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
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?
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 ?
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.
Hey how to call a external api inside Ajax call
Can you give me some specifics of what you are trying to do?