How to call a rest api to make an instance for me ?

  • 13 February 2020
  • 5 replies
  • 433 views

I am new in the K2 5 environement and current i am facing this issue so kinldy can you guys help me out.

Kindly can you guys let me know the step by step procedure of calling a REST api to make an instance for me in my k2 I have tried doing it but cant understand it so please ellaborate step by step.

It will be highly appreciated.! 


5 replies

Badge +7

You can find the steps here:

https://help.k2.com/onlinehelp/k2five/userguide/5.3/default.htm#ServiceBrokers/EndPoints/REST_Endpoint.htm

 

 

Integrating a REST-based Service with K2: All you need to know:

https://help.k2.com/kb001757

 

 

Similar issue:

https://community.k2.com/t5/K2-Blackpearl-Forum-Posts/Make-REST-calls-via-a-Smart-Object/td-p/69300/page/2

 

 

hello  @rubab 


 


You can also watch the following video on how to create a rest service instance and smartObject


Hi @HulisaniN ,

Thanks for responding. I think my question was not very clear. What I am trying to do is calling K2 REST API to start a workflow instance. We are following this part of documentation for this purpose. https://help.k2.com/onlinehelp/k2five/DevRef/current/default.htm#Runtime/WF-REST-API/WF-REST-API.htm%3FTocPath%3DRuntime%2520APIs%2520and%2520Services%7CWorkflow%7CWorkflow%2520REST%2520API%7C_____0

Our eventual goal is to create K2 workflow instances from an external web application, but for now we are trying to call this service using POSTMAN. I am having issue passing values for Smart Object in ItemReferences, the documentation provided at https://help.k2.com/onlinehelp/k2five/DevRef/current/default.htm#Runtime/WF-REST-API/Workflow-REST-API-Item-References.htm%3FTocPath%3DRuntime%2520APIs%2520and%2520Services%7CWorkflow%7CWorkflow%2520REST%2520API%7CWorkflow%2520REST%2520API%2520Samples%7C_____4  tells me to pass an ID to the smart object, but I don't know how to get that id. 

Right now, an object is created in result of my API call from postman, but data is not being populated there. And clicking on that form shows error for the data object. I am attaching screenshots for the error message as well as REST API call from POSTMAN. Please let me know if anything else is needed to look into this?

 

Regards,



Good day  @rubab 


 


Thanks for the description of your problem, I did some research on the error you got when clicking on that form and found a link that may be helpful:


https://community.k2.com/t5/K2-Appit-Articles/item-SmartObject-property-ID-is-a-required-property-Value-must/ta-p/82688


 


I also found some similar problems :


1. https://community.k2.com/t5/K2-Blackpearl-Forum-Posts/SmartObject-property-ID-is-a-required-property-for-selected/td-p/98544


2. https://community.k2.com/t5/K2-Blackpearl-Forum-Posts/smartobject-property-ID-is-required-property-for-selected-method/td-p/90926 


 


Regards 


Hulisani

@HulisaniN 

Thanks for responding. We have already seen those articles but they are of little help because they are not starting workflow using API. In our case, process workflow works fine when we do it manually, but gives error when calling via REST API. We are using K2 FIVE 5.3 version. If there are any examples for how to fix this error while calling from API, will highly appreciate that help.

 

Regards,

Rubab Fatima


@HulisaniN wrote:

Good day  @rubab 

 

Thanks for the description of your problem, I did some research on the error you got when clicking on that form and found a link that may be helpful:

https://community.k2.com/t5/K2-Appit-Articles/item-SmartObject-property-ID-is-a-required-property-Value-must/ta-p/82688

 

I also found some similar problems :

1. https://community.k2.com/t5/K2-Blackpearl-Forum-Posts/SmartObject-property-ID-is-a-required-property-for-selected/td-p/98544

2. https://community.k2.com/t5/K2-Blackpearl-Forum-Posts/smartobject-property-ID-is-required-property-for-selected-method/td-p/90926 

 

Regards 

Hulisani


 

Reply