CRUD API GET Returns Fields I dont want

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Alan
    Junior Member
    • Jun 2021
    • 10

    CRUD API GET Returns Fields I dont want

    I'm trying to only return the Lead (id) number and Lead (status) field on a GET.
    I read about the roles so disallowed all the fields apart from id and status in Leads.
    All others in Roles are disabled and the permissions at the top of the roles are set to no
    My issue is that it still returns "deleted" and "isFollowed".
    So I receive:
    {
    "id": "661c2d62a8b0702e1",
    "deleted": false,
    "status": "Dead",
    "isFollowed": false
    }

    These two fields are not in the Leads that I can set to no.
    Does anyone know what I need to do so that "deleted" and "isFollowed" don't show/return on my GET?​
  • emillod
    Active Community Member
    • Apr 2017
    • 1405

    #2
    You can specify with select param which fields should be returned. Here you have an example: demo.eu.espocrm.com/api/v1/Opportunity?select=amountCurrency%2Camount%2Cclose Date%2CassignedUserId%2CassignedUserName%2Cstage%2 CaccountId%2CaccountName%2Cname&maxSize=20&offset= 0&orderBy=createdAt&order=desc

    Comment

    • Alan
      Junior Member
      • Jun 2021
      • 10

      #3
      Thanks for the reply, however, when i post a GET with...../api/v1/Lead/661c2d62a8b0702e1?select=status
      I still get the unwanted fields back
      {
      "id": "661c2d62a8b0702e1",
      "deleted": false,
      "status": "Dead",
      "isFollowed": false
      }​

      Comment

      • yuri
        Member
        • Mar 2014
        • 8443

        #4
        It's not possible. You can create your own API entry point if it's really important for your case. But I'd recommend just leave it as it is.
        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...