Do you want to: Suggest a feature / Report a bug / Ask a how-to question
For feature suggestions, describe the result you would like to achieve in detail: N/A
For bug reports, provide the steps to reproduce and if possible a minimal demo of the problem:
When running the “Update an opportunity” using the PUT API I am getting a 400 error. WIth the message being “Value does not fall within the expected range.”. I am using Postman and sending the data in the body as a JSON object. It looks as follows:
{
"responsibleid": "GUID of user",
"accessList": [
"GUID of user"
]
}
Here is the error message from postman:
{
"status": 1,
"statusCode": 400,
"error": {
"message": "Value does not fall within the expected range.",
"hresult": -2147024809,
"data": {}
}
}
Community Server/Control Panel version: 12.6.0.21
Type of installation of Workspace (docker, deb/rpm, exe, please point us to the installation guide that you used as well): N/A
OS: N/A
Browser version: N/A
Additional information: This is for our cloud based onlyoffice portal.
Any relevant details about the situation. If you’ve modified configuration files or are using a proxy server that might affect the situation, please mention it. You can also attach images and videofile to the post (or to place them to external storage)
Hello @aloreaux 
We need some time to reproduce this issue. If we find any information, solutions, or have additional questions regarding this problem, we will notify you.
Thank you.
Hi is there any update on this?
Hello @aloreaux 
First of all, I sincerely apologize for losing track of your task—it was not intentional. I also realized that I might not fully understand what exactly you’re trying to achieve.
Could you please provide more details about your request? Specifically, it would be helpful if you could clarify:
- What exactly you would like to update?
- Any specific details or scenarios related to the task?
Additionally, I wanted to suggest a potential improvement for your request. Have you considered adding the "isPrivate": true
or "isPrivate": false
field to your request body? This might be useful if the opportunity needs specific privacy settings. For example:
{
"responsibleid": "GUID of user",
"isPrivate": true,
"accessList": [
"GUID of user"
]
}
This could address some of the issues related to visibility or data restrictions.
Lastly, could you let me know which API documentation you’ve been using as a reference? It would help ensure we’re aligned and looking at the same guidelines.
Hi @Nikolas ,
I am using this documentation: OnlyOffice API Docs
An issue we run into is if someone leaves our company there is not a bulk way to update the companies, opportunities and persons so that a new person can have access to them.
So I was trying to write a little script that can take a list of opportunities by id and add the new user to the access list.
Thanks!
Hello @aloreaux
I believe it is possible to achieve with following APIs:
Hi @Nikolas,
I am using the latest API Docs and I am still getting this error:
{
"status": 1,
"statusCode": 400,
"error": {
"message": "Value does not fall within the expected range.",
"hresult": -2147024809,
"data": {}
}
}
Here is the body that I am sending:
{
"opportunityid": OpportunityID,
"responsibleid": "GUID of User",
"isPrivate": true,
"accessList": [
"GUID of User"
]
}
Using Update an opportunity - PUT
with this URL: /api/2.0/crm/opportunity/{opportunityid:[0-9]+}
I do not have this issue with companies and contacts. Any update on this?
Here is the link I am using now for documentation: Update an opportunity
As I can see you are passing opportunityid
as a variable, how are you getting it in the first place?
@Constantine for testing purposes I have been just grabbing it manually from a dummy opportunity I created.
So OpportunityID
actually represents a real ID, is that correct?
Please try using this method:
Thanks @Constantine, I have read that too. I will wait from a response from @Nikolas
1 Like
Hey @aloreaux
I agree with @Constantine’s suggestion regarding the use of Get filtered opportunities and Set access rights to the filtered opportunities APIs. Based on the latest documentation you’ve shared, your approach seems correct.
Could you clarify what additional information or guidance you would like from us? I want to ensure that we provide exactly what you need. Are you looking for alternative methods, a workaround, or perhaps specific debugging steps?
I agree the access rights works @Nikolas . My issue is, if trying to update the responsible user, I get the error message I have mentioned above, is it not possible to change the responsibleId? And once the responsibleId is set you cannot change it through the API? You can only add users the access list? Thank you.
@aloreaux
I’ll take a look into this issue and will get back to you as soon as I have any updates.
In the meantime, could you please try the following? According to the documentation, the request needs to be complete—individual body fields can’t be used separately.
Here’s an example of a full request body we use to change the responsible user from one to another:
{
"opportunityid": 1,
"contactid": 1,
"members": [1],
"title": "title",
"description": "description",
"responsibleid": "77346943-4a28-8388-a45f-ca939e554536",
"bidType": 0,
"bidValue": 100,
"bidCurrencyAbbr": "USD",
"perPeriodValue": 0,
"stageid": 3,
"successProbability": 1,
"actualCloseDate": null,
"expectedCloseDate": null,
"customFieldList": null,
"isPrivate": true,
"accessList": ["77346943-4a28-8388-a45f-ca939e554536"],
"isNotify": false
}