Format uids for API body

I have run into this in a couple of places, but the one I am working on now is this:

https://domain.teamdynamix.com/TDWebApi/api/people/bulk/changeactivestatus?isActive=false

The documentation says "Request Body (Validated as "uids")".  How should that be formatted?  I have tried dozens of combinations and can't figure it out.  I continue to get "A positional parameter cannot be found that accepts argument <argument I used>"

Update:  That error was due to punctuation...  Here is the current error:  

Exception Message: Cannot deserialize the current JSON object (e.g. {\"name\":\"value\"}) into type 'System.Collections.Generic.IEnumerable`1[System.Guid]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.\r\nTo fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.

Here is what I am sending:


   "uids": [
      "user 1 uid", 
      "user 2 uid"
   ] }

I am using PowerShell, but if I could see the format in JSON I'm sure I could translate it.

Non-bulk API calls work fine.

Tags API
Asked by John Shearer on Fri 12/13/24 2:58 PM Last edited Fri 12/13/24 4:02 PM
Sign In to leave feedback or contribute an answer

Answer (1)

This answer has been marked as the accepted answer
Mark Sayers Mon 12/16/24 12:30 PM

Hello John,

The call body for this would just be an array of user UIDs, like so:

[ Uid1, Uid2, Uid3, etc]

Sincerely,
Mark Sayers
Sr Support Consultant, CS

1 of 1 users found this helpful.
Perfect - that has to be literally the only format I didn't try... - John Shearer Tue 12/17/24 11:17 AM