Is there a way to get the user email from expansions in the REST API

sabzx February 9, 2020

Eg: If I make a cql search for a particular user id mention, can I somehow fetch the user email in the same API call ?

 

http://localhost:8090/rest/api/content/search?cql=(mention != 'anonymous' and type='comment' and created>now("-15h") )&expand=history,version

 

 

1 answer

0 votes
DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 9, 2020

@sabzx  Simple answer is no. The API you are using here is for content, and you will only get user name and user key as users information.

sabzx February 10, 2020
Thanks @DPKJCurrently the API does not return any information about the mentionee. It only has information about the mentioner. Is there anyone way to get the mentionee's information?

{
"results": [
{
"id": "65635",
"type": "comment",
"status": "current",
"title": "Re: Product",
"body": {
"_expandable": {
"editor": "",
"view": "",
"export_view": "",
"styled_view": "",
"storage": "",
"anonymous_export_view": ""
}
},
"extensions": {
"location": "footer",
"_expandable": {
"resolution": ""
}
},
"_links": {
"webui": "/display/PROD/Product?focusedCommentId=65635#comment-65635",
"self": "http://localhost:8090/rest/api/content/65635"
},
"_expandable": {
"container": "/rest/api/content/65591",
"metadata": "",
"operations": "",
"children": "/rest/api/content/65635/child",
"restrictions": "/rest/api/content/65635/restriction/byOperation",
"history": "/rest/api/content/65635/history",
"ancestors": "",
"version": "",
"descendants": "/rest/api/content/65635/descendant",
"space": "/rest/api/space/PROD"
}
},
],
"start": 0,
"limit": 25,
"size": 2,
"cqlQuery": "(mention != 'anonymous' and type='comment' and created>now(\"-72h\") )",
"searchDuration": 27,
"totalSize": 2,
"_links": {
"self": "http://localhost:8090/rest/api/content/search?expand=body&cql=%28mention%20%21=%20%27anonymous%27%20and%20type=%27comment%27%20and%20created%3Enow%28%22-72h%22%29%20%29",
"base": "http://localhost:8090",
"context": ""
}
}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events