Answered

How to get currentUser email using Miro object

  • 19 April 2021
  • 3 replies
  • 35 views

Badge +2

I want to get current user email address on Miro board load using Miro object. Please help me which object we have to use to get current user email.

icon

Best answer by Anthony Roux 10 May 2021, 20:32

Hi @janardhan,

 

You can use the Get Current User REST API.

 

A cURL example would be (don’t forget to replace {access_token} by your access_token)

Query:

curl --request GET \
--url https://api.miro.com/v1/users/me \
--header 'Authorization: Bearer {access_token}'

Response:

{
"type" : "user",
"id" : "xxx",
"name" : "Anthony Roux",
"createdAt" : "2021-04-01T09:35:41Z",
"company" : "Miro",
"role" : "developer",
"industry" : null,
"email" : "xx@miro.com",
"state" : "registered",
"picture" : {
"type" : "picture",
"imageUrl" : "xxx",
"id" : "xxx"
}
}

 

Regards,

Anthony

View original

3 replies

Userlevel 7
Badge +14

@janardhan -

Are you referring to a development method via Miro’s API or a native command? If you mean natively I don’t believe there’s any way to see user e-mail addresses in a board, but assuming you have access to the team’s Active Users view (by clicking on the team “gear” icon in the Dashboard) you could see their e-mail addresses under their user names in the list of users.

Kiron

Userlevel 7
Badge +16

@janardhan - It does seem like you are referring to using the Miro Developer Platform, therefore I am moving this post to the Developer Platform and APIs category.

As @Kiron Bondale mentioned, the currentUser email will not be stored in the board, otherwise anyone could see this using a browser’s developer tools. It is my limited understanding that you would use the SDK to get the object creator’s ID and then I assume you could use the REST API to get more user details - more info on this can be found in the developer platform documentation.

Userlevel 2
Badge +6

Hi @janardhan,

 

You can use the Get Current User REST API.

 

A cURL example would be (don’t forget to replace {access_token} by your access_token)

Query:

curl --request GET \
--url https://api.miro.com/v1/users/me \
--header 'Authorization: Bearer {access_token}'

Response:

{
"type" : "user",
"id" : "xxx",
"name" : "Anthony Roux",
"createdAt" : "2021-04-01T09:35:41Z",
"company" : "Miro",
"role" : "developer",
"industry" : null,
"email" : "xx@miro.com",
"state" : "registered",
"picture" : {
"type" : "picture",
"imageUrl" : "xxx",
"id" : "xxx"
}
}

 

Regards,

Anthony

Reply