Example calling API from inside view

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • l4k3y
    Junior Member
    • Feb 2024
    • 6

    Example calling API from inside view

    Hi,

    I was wondering whether anyone may be able to help by providing an example of how to call an API from inside my view? And how to have actions inside the view to be able to update parameters that would recall the API and then rerender the view? Such as a search component?

    Thanks



  • yuri
    Member
    • Mar 2014
    • 8440

    #2
    Easy:

    Code:
    Espo.Ajax.getRequest('MyEndpont').then(response => {
    
    });
    Code:
    Espo.Ajax.postRequest('MyEndpont', {param1: value1}).then(response => {
    
    });
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    Working...