Update room details using API

I'm attempting to use the API endpoint https://solutions.teamdynamix.com/TDWebApi/api/locations/{id}/rooms/{roomId} to update a room.  I am using Python for this request.  Here's the relevant parts of my code:

data = {'Name': newRoomName}
room_response = requests.put(updateRoomURL, headers={
"Authorization": 'Bearer ' + auth,
"Content-Type": "application/json charset=utf-8"
}, json=data
)
 
When running the script I am returned a 415 status code which seems to mean Unsupported Media Type.
 
Any thoughts on what I'm doing wrong? I'm assuming it is something in the way I'm building the request. I am able to pull location information as well as delete rooms, just cannot update them.
 
I appreciate any help you can provide.
Tags API location-room
Asked by Justin Hart on Wed 3/27/24 4:28 PM
Sign In to leave feedback or contribute an answer

Answer (1)

This answer has been marked as the accepted answer
Mark Sayers Wed 3/27/24 4:40 PM

Hello Justin,

First, are you making that call using the PUT command?

And secondly, the endpoint in question has an access note stating: This action requires the "All: Create and modify the list of locations and their rooms" permission.

Did you verify that your account you're signing into the API with has that security role permission?

(You'll need to be signing into the API with a User or Service Account that exists in the TDAdmin > Users & Roles > Users area of TDAdmin, not the Admin API Service account located at the root level of TDAdmin).

Sincerely,
Mark Sayers
Sr Support Consultant, CS

No feedback
Thank you Mark. Yes, I'm using the PUT command. I'm confirming with our on-site TeamDynamix admin on the permissions. - Justin Hart Wed 3/27/24 4:43 PM
We've confirmed the API account has the necessary permissions. Any other thoughts you have would be appreciated. - Justin Hart Fri 3/29/24 8:46 AM