Insufficient Error Response on Create Points Transaction REST Endpoint

My Source Material: Create Point Transaction Point Transaction REST Endpoint - API Documentation - Verint Community 11.x - Verint | Telligent Community

What I'm trying to do:

Create a mechanism to handle points assignments based around a document or list.

What I've got working:

I've written a few PowerShell functions that'll handle this processing in bulk which works 99% (the 1% described below).  Only the functions are posted in my GitHub.  The process is:

  1. Open CSV.
  2. Find Username, Description, Points to be Awarded, and (optional) the Date for the assignment.
  3. Search for each user in the community via Username (GET)
  4. Capture their User ID, their ContentID, and their ContentTypeID.
  5. Build a body to send to the Create Points endpoint via POST.
  6. Execute the POST and capture the point transaction Id and transaction time.
  7. Store them back into the CSV file.

This works correctly with a minor exception.  The Create Point transaction doesn't seem to honor the "CreatedDate" field.

What's not working:

I'm trying to do this 'better' by doing it in SharePoint and using a list with Power Automate.

It's working correctly for pulling the user's id, ContentType, and ContentTypeID.

I build the JSON body for the POST to Create Point Transaction (and I'm also saving a copy to a file share for good measure). 

{
    "Description": "<p>Completion of Automated Points Awarding Process [427 Points]</p>",
    "UserId": "2109",
    "Value": "427",
    "ContentId": "e936538a-891a-451a-9982-037099b9dbf4",
    "ContentTypeId": "e9ed4118-60ed-4f2b-a026-5705b8793d05",
    "CreatedDate": "2021-03-08T00:00:00"
}

Note: The actual JSON is linearized, the above is formatted for easier reading.

I make the call with the appropriate headers, but get the error I get returned is:

{
  "": null,
  "Errors": [
    "Description is required"
  ]
}

I know for a fact that "Description" is defined, so there's another error, but something else is off.  I recall seeing a similar message when I wrote the PowerShell scripts - which was also wrong.

What I've tried to no avail: removing the quotes from around the integer elements (UserId, Value).

I'd appreciate any assistance I can get on this!

Parents
  • Former Member
    0 Former Member

    in your func_points.ps1 does your $Body object need to be converted to JSON?

    $Body = @{
        Description = "<p>$Description</p>";
        UserId = $UserId;
        Value = $Points;
        ContentID = $ContentId;
        ContentTypeId = $ContentTypeId;
        CreatedDate = $AwardDateTime;
    }
    try {
        $PointsRequest = Invoke-RestMethod -Uri ( $CommunityDomain + $Uri ) -Method Post -Body $Body -Headers $AuthHeader
        $PointsRequest.PointTransaction
        }
        catch {
        Write-Error -Message "Something didn't work"
    }

  • I'm honestly not 100% sure about if I need to convert the date to a specific string format.  I don't think I do because it works with other API calls for reading, but I may need to test that out a little more.  I wish I could find an explicit definition of the DateTime format in the Verint/Telligent API docs.  Just searching for 'DateTime' leads to waaaaaaay too many articles.  It's almost like the phrase is popular or something...  Thinking

Reply
  • I'm honestly not 100% sure about if I need to convert the date to a specific string format.  I don't think I do because it works with other API calls for reading, but I may need to test that out a little more.  I wish I could find an explicit definition of the DateTime format in the Verint/Telligent API docs.  Just searching for 'DateTime' leads to waaaaaaay too many articles.  It's almost like the phrase is popular or something...  Thinking

Children