Have you ever tried making an api call from your javascript controller in sugar. How do you create your api url? Ever used app.api.buildURL() ? Any idea what are the parameters this method accepts? Don’t worry. Try it out when you write your next api call.
Use app.api.buildURL() to build url for your api calls. The method comes with four parameters as below.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
m - Module name. | |
e - End point name. | |
r - Object containing current record data. Eg: pass your current record id as {id:<current-recrod-id>} | |
p - Other parameters. Eg: limit of records,orderBy etc. | |
**/ | |
app.api.buildURL(m,e,r,p); |
Follow my blog to get daily tips……:)