ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

Forums OroCRM rest json api returns 403 on update lead

This topic contains 6 replies, has 2 voices, and was last updated by msulima msulima 5 months, 1 week ago.

  • Creator
    Topic
  • #59527

    kaushal.padaria.hs
    Participant

    When i try to update lead with relations field it returns 403 error

    request body

    {
    “data”: {
    “type”: “leads”,
    “id”: “550”,
    “attributes”: {
    “projectObjective”: null,
    “annualRevenue”: null,
    “sdate_edate”: null,
    “marketing_suggestions”: null,
    “lead_address”: “owner George”,
    “pin_code”: null,
    “vacancy_link”: “https://cnj.craigslist.org/cpg/6168813911.html”,
    “startDate”: null,
    “endDate”: null,
    “lead_type”: “Cold”,
    “budget_upto_currency”: null,
    “vacancy”: false,
    “deptStrength”: null,
    “size_of_company”: null,
    “lead_document”: null,
    “assign_to_campaign”: null,
    “address2”: null,
    “address1”: null,
    “deleted_at”: null,
    “global_rank”: null,
    “monthly_visits”: null,
    “revenue_range”: null,
    “technology_coverage”: null,
    “lead_timezone”: null,
    “lead_primaryemail”: null,
    “lead_primaryphone”: null,
    “revenue_currency”: null,
    “name”: “Sole Gano”,
    “namePrefix”: null,
    “firstName”: null,
    “middleName”: null,
    “lastName”: null,
    “nameSuffix”: null,
    “jobTitle”: null,
    “companyName”: “Sole Gano”,
    “website”: “http://www.solegrano.com/”,
    “numberOfEmployees”: null,
    “industry”: null,
    “createdAt”: “2017-06-09T18:53:45Z”,
    “updatedAt”: “2017-06-14T21:26:35Z”,
    “notes”: null,
    “twitter”: null,
    “linkedIn”: null
    },
    “relationships”: {
    “contact”: {
    “data”: null
    },
    “phones”: {
    “data”: [
    {
    “type”: “leadphones”,
    “id”: “719”
    }
    ]
    },
    “emails”: {
    “data”: []
    },
    “addresses”: {
    “data”: [
    {
    “type”: “leadaddresses”,
    “id”: “412”
    }
    ]
    },
    “owner”: {
    “data”: {
    “type”: “users”,
    “id”: “12”
    }
    },
    “opportunities”: {
    “data”: []
    },
    “organization”: {
    “data”: {
    “type”: “organizations”,
    “id”: “1”
    }
    },
    “customer”: {
    “data”: null
    },
    “dataChannel”: {
    “data”: {
    “type”: “channels”,
    “id”: “1”
    }
    },
    “source”: {
    “data”: {
    “type”: “leadsources”,
    “id”: “linkedin”
    }
    },
    “status”: {
    “data”: {
    “type”: “leadstatuses”,
    “id”: “waiting_for_client_response”
    }
    },
    “clientBudget”: {
    “data”: null
    },
    “timeFrame”: {
    “data”: null
    },
    “contactType”: {
    “data”: null
    },
    “need”: {
    “data”: []
    },
    “currency”: {
    “data”: null
    },
    “country”: {
    “data”: {
    “type”: “countries”,
    “id”: “US”
    }
    },
    “region”: {
    “data”: {
    “type”: “regions”,
    “id”: “US-NJ”
    }
    },
    “lead_category”: {
    “data”: null
    },
    “assigned_lead”: {
    “data”: null
    },
    “category_lead”: {
    “data”: []
    },
    “range_revenue”: {
    “data”: []
    }
    }
    }
    }

    response

    {
    “errors”: [
    {
    “status”: “403”,
    “title”: “access granted constraint”,
    “detail”: “You have no access to set this value.”,
    “source”: {
    “pointer”: “/data/relationships/phones/data/0”
    }
    },
    {
    “status”: “403”,
    “title”: “access granted constraint”,
    “detail”: “You have no access to set this value.”,
    “source”: {
    “pointer”: “/data/relationships/addresses/data/0”
    }
    },
    {
    “status”: “403”,
    “title”: “access granted constraint”,
    “detail”: “You have no access to set this value.”,
    “source”: {
    “pointer”: “/data/relationships/source/data”
    }
    },
    {
    “status”: “403”,
    “title”: “access granted constraint”,
    “detail”: “You have no access to set this value.”,
    “source”: {
    “pointer”: “/data/relationships/status/data”
    }
    },
    {
    “status”: “403”,
    “title”: “access granted constraint”,
    “detail”: “You have no access to set this value.”,
    “source”: {
    “pointer”: “/data/relationships/country/data”
    }
    },
    {
    “status”: “403”,
    “title”: “access granted constraint”,
    “detail”: “You have no access to set this value.”,
    “source”: {
    “pointer”: “/data/relationships/region/data”
    }
    }
    ]
    }

    i m logged in with superadmin having full access to all entity still getting 403

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
    Replies
  • #59529

    kaushal.padaria.hs
    Participant

    orocrm version is 1.10

    #59530
    msulima
    msulima
    Moderator

    Hi,

    unfortunately I can’t do full check of your api request data, because I don’t have all required information. https://www.orocrm.com/forums/topic/please-read-before-start-a-topic-with-technical-question

    What version of OroCRM you use? Also, will help to have database dump to check what wrong.

    I just tried some part of your request and it seems some of fields that you want to change can’t be changed with request as you provide.

    So, question is what field you want to change by api?


    #59531

    kaushal.padaria.hs
    Participant

    hii,

    I want to update lead status using rest json api. status is enum field. i am using orocrm 1.10

    #59532
    msulima
    msulima
    Moderator

    Next data works for me (tested on 1.10 version for PATCH api request):


    #59533

    kaushal.padaria.hs
    Participant

    do i need to add any configuration in api.yml? because i m getting 403 error in response but if i remove

    then it works and data gets updated.

    #59534
    msulima
    msulima
    Moderator

    No additional changes required. You should use PATCH request with id of concrete entity. I tested it on last released version of 1.10 and my example worked.


Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

ssossossosso