Question


Sakhatech Information Systems Pvt Ltd
IN
Last activity: 31 Jul 2019 9:43 EDT
Pega API - calling assignments API for performing an assignment
HI,
I am in need of submitting an assignment through a thirdparty web application. I know that /assignments/{ID} is the API for submitting an assignment. But i dont find any documentation or sample to pass parameters to this rest API. The below screenshot shows the documentation for this API, but it is not clear what should be the values for these parameters.
Assume that i have an assignment with 3 fields in it.
- Name ( text )
- Age ( integer )
- Date Of Birth ( Date )
Please let me know how to call this API to perform the action through API


Sakhatech Information Systems Pvt Ltd
IN
Accepted Solution
The ID parameter is the assignment's pzInsKey, like:
- ASSIGN-WORKLIST O59ALY-SCULPTURE-WORK I-21!SCULPT_FLOW
The actionID is the ID of the flow action, like:
- SubmitExpenseReport
The post body has the properties like this:
{
"content" : {
"Name" : "Ratheesh",
"Age" : 45,
"DOB" : "19730816",
"DateAndTimeOfBirth: "19730816T161555.716 GMT"
}
}
I hope this helps!


Sakhatech Information Systems Pvt Ltd
IN
Thanks Marik for your reply. I will try and let you know.
How do I refer to more complex content like a table?
{
content: {
"myPageList" : [
{
"field1" : "row1value"
},
{
"field1" : "row2value"
}
]
}
}


Cognizant Technology Solution
IN
How to do add note in this ? I am need to know content part


Cognizant Technology Solution
IN
I want to add note to a case through api. I have provide case I'd and action I'd. In request body :
content:(
"Subject": "abc",
"Note": "abc"
)
It is not working. Please ignore parentheses I used braces.
First of all, PUT /cases/{ID}?actionID=AddNote is the better choice for adding a note. Create a flow action AddNote for this purpose that takes transient fields Subject and Note set in the case body and creates a note out of them using the post-processing activity. The post-processing activity should create a page of class Data-WorkAttach-Note, and set pxAttachKey and pxAttachedBy in addition to the subject and note, then save it.


Cognizant Technology Solution
IN
Can you post actual json structure?
The JSON can be as you had it before, but you need to submit it with the right flow action that knows how to take those fields and put them into a note. I should add that attachment-style notes are deprecated nowadays in favor of pulse messages. We added POST /messages in recent versions.


Cognizant Technology Solution
IN
Thanks Marik, I have tried with pxAttchkey and pxAttachedBy. But I got 500 and then no content found
Updated: 25 Jul 2019 10:02 EDT
Unfortunately I think we've reached the limit of what can be achieved through this medium. I will need to write a Community Article with step-by-step instructions to showcase this.
Hi Soumitrab, actually before I write an article, what version of Pega are you on? POST /messages has been in the product since 8.1 aka Pega Infinity. You should use POST /messages to create case notes.


Cognizant Technology Solution
IN
I am using pega 7.3. Just want to clarify I want to local action add note and I am using submit assignment functionality. I tried both subject , note, and as you suggested I have tried also pxattachkey in json
7.3; I see. And why do you want to create an old attachment-style note over a pulse message?
I have not received any reply to this neither i could solve this.