Create a new function for api

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wmoghes
    Member
    • Aug 2017
    • 30

    Create a new function for api

    Hi, I need to know how can I create a new function for api
    for Example: http://localhost/api/v1/AccountOpening/{id} -> here id by default
    i need to create a new function to take the name of account opening rather than id to by like that http://localhost/api/v1/AccountOpening/{account-name}

    So, which file should i use it to add a new function

    and is there anyway to see all routes in espocrm or not
    Thanks in advanced
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    Hello

    All existing routes you could find in file data/cache/application/routes.php

    application/Espo/Modules/Crm/Resources/routes.json - an example of implementation

    You could add your routes custom/Espo/Custom/Resources/routes.json (don't forget to Clear Cache)
    custom/Espo/Custom/Controllers/{EntityName}.php - there have to be added a logical part (read other action for examples)

    Comment

    • wmoghes
      Member
      • Aug 2017
      • 30

      #3
      Thanks for you help

      Comment

      Working...