Hi,
I’m trying to update an object via string.
I got a GET call ready, and for a field with IDs I will get responses as “”, “50”,“51,52” for example. The results, even though numbers, is formatted as string, because it can be a list of IDs and as to my knowledge I can no format API responses as a list of something.
I want to add an ID. I don’t have to check, if the IF already exists, but it should work with those 3 possible scenarios ( “”, “50”,“51,52”) where adding the ID 99 e.g. would lead to the result of “99” “50,90”, “51,52,99”.
I’m a bit lost what to put in my request body to accomplish this. The PUT request is already set up with this body
{“ids”: <list_of_ids>}
Can s.b. help?
Thanks a lot!
I solved it myself. Didn’t see the obvious solution.
I separated it in multiple steps in my backend worklfow:
Step 1: GET
Step2:PUT; result of step 1 with “,ID” appended, Only when response IS NOT EMPTY (there are already 1+ IDs)
Step3:PUT with “ID”, Only when response IS EMPTY