Search code examples
actions-on-googlegoogle-home

Correct uri for DeleteAgentUser (Google Homegraph)


I'm trying to use the DeleteAgentUser of Homegraph to unlink a user with Google. I already implemented the ReportState and the correct uri for this is: https://homegraph.googleapis.com/v1/devices:reportStateAndNotification. So I thought the DeleteAgentUser has to be: https://homegraph.googleapis.com/v1/devices:deleteAgentUser but I'm getting a '404 Not Found' Error.

I tried it with:

https://homegraph.googleapis.com/v1/devices:deleteAgentUser
https://homegraph.googleapis.com/v1/deleteAgentUser
https://homegraph.googleapis.com/v1/devices:DeleteAgentUser
https://homegraph.googleapis.com/v1/DeleteAgentUser

everything with post and delete request and always getting the error.

What is the correct Homegraph uri to delete a user from Google?


Solution

  • Looking at the RPC defined in the public protobuf, it seems that the implementation is defined as:

    rpc DeleteAgentUser(DeleteAgentUserRequest) returns (google.protobuf.Empty) {
      option (google.api.http) = {
        delete: "/v1/{agent_user_id=agentUsers/**}"
      };
    }
    

    So, it seems like you'd send a DELETE request to https://homegraph.googleapis.com/v1/{agent_user_id} or maybe https://homegraph.googleapis.com/v1/agentUsers/{agent_user_id} with your agent user id, and signed with your authorization token similar to Report state.