Forum Discussion

perk's avatar
perk
Adept
11 years ago

What is restadmin?

We have these this line of code in our endpoints for zendesk integration:

 

<#assign username = restadmin("/settings/name/custom_zendesk.username").value />

 

What is restadmin? What does it contain?

11 Replies

  • OlivierS's avatar
    OlivierS
    Lithium Alumni (Retired)
    11 years ago

    perk it's an object to make a REST call with Administrator permissions on behalf of the user viewing the component. This call essentially bypasses permission checks for the current user.

     

    From your code, it looks like you call the 'settings' API method to retrieve the value of the field 'custom_zendesk.username' and assign it to a variable called 'username':

     

    <#assign username = restadmin("/settings/name/custom_zendesk.username").value />

     

    More details on the restadmin context object here.