I am working on Google Classroom Pub/Sub Notification. I have task which is create the pub/sub topic and subscription by using the Rest API. I have created the pub/sub topic successfully but when i am setting the IAM Policy/Permissions for created topic then i am getting the error message.
API URL:- https://pubsub.googleapis.com/v1/projects/project-abc/topics/xyz-topic-101:setIamPolicy API Method:- POST API Request Body:-
{
"policy": {
"bindings": [
{
"role": "roles/owner",
"members": [
"[email protected]",
"[email protected]"
]
},
{
"role": "roles/pubsub.admin",
"members": [
"[email protected]",
"[email protected]"
]
},
{
"role": "roles/pubsub.editor",
"members": [
"[email protected]",
"[email protected]"
]
},
{
"role": "roles/pubsub.publisher",
"members": [
"[email protected]",
"[email protected]"
]
},
{
"role": "roles/pubsub.subscriber",
"members": [
"[email protected]",
"[email protected]"
]
}
],
"version": 1
}
}
API Response:- { "error": { "code": 400, "message": "The member [email protected] is of an unknown type. Please set a valid type prefix for the member.", "status": "INVALID_ARGUMENT" } }
I have follow the below Google Doc Link:- https://cloud.google.com/pubsub/docs/reference/rest/v1/Policy#Binding I am not getting that why this message is coming. Please share your suggestions & feedback's.