# REST API: Process Instantiation problem

**URL:** <https://community.ofelia.com/t/rest-api-process-instantiation-problem/8769>\
**Category:** Q&A\
**Created:** [3 October 2017 07:35 UTC](https://community.ofelia.com/t/rest-api-process-instantiation-problem/8769 "2017-10-03T07:35:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![claudio.melis\_135071](https://avatars.discourse-cdn.com/v4/letter/c/e47774/32.png) [@claudio.melis\_135071](https://community.ofelia.com/u/claudio.melis_135071)\
**Post date:** [3 October 2017 07:35 UTC](https://community.ofelia.com/t/rest-api-process-instantiation-problem/8769/1 "2017-10-03T07:35:04Z")

</div>

Hi, I’m trying to instantiate a process via rest api  
“/API/bpm/process/”+process\_definition\_id+“/instantiation”

and json:

{  
‘description’: ‘test’,  
‘supplierIds’: 6,  
‘summary’: ‘test’  
}

but I get this error:  
Exception: HTTP STATUS: 400 {“exception”:“class org.bonitasoft.engine.bpm.contract.ContractViolationException”,“message”:“Error while validating expected inputs”,“explanations”:[“6 cannot be assigned to INTEGER”]}

someone can help me?  
thanks  
Claudio

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/community_bonitasoft/original/2X/6/6b7b18c0478f2645369e82e009b65e3b97f2cc12.svg) [@system](https://community.ofelia.com/u/system)\
**Post date:** [4 October 2017 12:07 UTC](https://community.ofelia.com/t/rest-api-process-instantiation-problem/8769/2 "2017-10-04T12:07:07Z")

</div>

You are trying to instantiate the process named “Procurement request” that is part of the [Procurement](http://community.ofelia.com/project/procurement-example) example.

The contract of this process expect three inputs:

- summary: a text
- description: a text
- supplierIds: an array of number (JSON) translate to a List

So your JSON is currently invalid. A valid equivalent would be:

{  
‘description’: ‘test’,  
‘supplierIds’: [6],  
‘summary’: ‘test’  
}

Actually the error message is misleading. Instead of “6 cannot be assigned to INTEGER” it should be “6 cannot be assigned to List of INTEGER”. I open a request to get that fixed.

---

<div class="post-metadata">

**Author:** ![Dibyajit.Roy](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@Dibyajit.Roy](https://community.ofelia.com/u/Dibyajit.Roy)\
**Post date:** [4 October 2017 09:31 UTC](https://community.ofelia.com/t/rest-api-process-instantiation-problem/8769/3 "2017-10-04T09:31:23Z")

</div>

Hello  
I have seen similar error in my Processes before.  
I stopped using integer and started using strings to store all values.  
But i have seen that the variable of type double works better.  
Usually I save all numeric data as double.  
Try and see if double is allowed.  
Also make sure the datatype in your contract is formatted correctly.

regards

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/community_bonitasoft/original/2X/6/6b7b18c0478f2645369e82e009b65e3b97f2cc12.svg) [@system](https://community.ofelia.com/u/system)\
**Post date:** [4 October 2017 09:38 UTC](https://community.ofelia.com/t/rest-api-process-instantiation-problem/8769/4 "2017-10-04T09:38:11Z")

</div>

If you can share the process .bos file (using Google Drive, Dropbox,…) I’d like to reproduce the issue.

Thanks

---

<div class="post-metadata">

**Author:** ![claudio.melis\_135071](https://avatars.discourse-cdn.com/v4/letter/c/e47774/32.png) [@claudio.melis\_135071](https://community.ofelia.com/u/claudio.melis_135071)\
**Post date:** [4 October 2017 09:42 UTC](https://community.ofelia.com/t/rest-api-process-instantiation-problem/8769/5 "2017-10-04T09:42:07Z")

</div>

the bos file is [https://github.com/Bonitasoft-Community/procurement-example](https://github.com/Bonitasoft-Community/procurement-example)

---

<div class="post-metadata">

**Author:** ![claudio.melis\_135071](https://avatars.discourse-cdn.com/v4/letter/c/e47774/32.png) [@claudio.melis\_135071](https://community.ofelia.com/u/claudio.melis_135071)\
**Post date:** [4 October 2017 12:10 UTC](https://community.ofelia.com/t/rest-api-process-instantiation-problem/8769/6 "2017-10-04T12:10:31Z")

</div>

thx so much antoine!

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/community_bonitasoft/original/2X/6/6b7b18c0478f2645369e82e009b65e3b97f2cc12.svg) [@system](https://community.ofelia.com/u/system)\
**Post date:** [4 October 2017 12:22 UTC](https://community.ofelia.com/t/rest-api-process-instantiation-problem/8769/7 "2017-10-04T12:22:39Z")

</div>

You’re welcome.

Quick note: please use “comment” instead of posting a new answer. We try to use “answer” to only actually provide a full valid answer to the question asked.
