Searching for Posts

You can search for backed-up Microsoft Teams posts.

Request

POST https://<hostname>:4443/v6/RestoreSessions/{restoreSessionId}/organization/teams/{teamId}/posts/search

Request Headers

The request header must contain an authorization token of the current session.

Request Parameters

The following parameters must be specified in the URL of the request:

Parameter

Type

Description

restoreSessionId

string

Specifies the identification number of the restore session. For more information on how to get this parameter, see Getting Restore Sessions.

teamId

string

Specifies the identification number of the team. For more information on how to get this parameter, see Getting Teams.

Request Body

The request body must contain the following property:

Property

Type

Description

query

string

Specifies query parameters used to search for Microsoft Teams posts. For more information, see Query Parameters.

Query Parameters

The following table lists examples of parameters that you can use in the query string to search for Microsoft Teams posts.

For the complete list of supported query parameters, see Appendix A. Item Search Parameters.

Parameter

Type

Description

author

string

Specifies the name of the user who created the post.

Query example: author: admin.

created

string

Specifies the time when the post was created.

Query example: created: this year.

modified

string

Specifies the time of the latest modification of the post.

Query example: modified: this year.

hasattachments

string

Defines whether the post has attachments.

Query example: hasattachments: true.

body

string

Specifies the part of the post message body.

Query example: body: important.

subject

string

Specifies the post subject or part of the post subject.

Query example: subject: announcement.

Request Example

Request:

POST https://abc.tech.local:4443/v6/RestoreSessions/1a4df11a-2220-42a9-b3a0-d25cdb8e5fcb/organization/teams/448c5b66-8dcd-4c75-b636-d3b500bce36f/posts/search

 

Request Header:

Authorization: Bearer <Access-Token>

 

Request Body:

{
  "query": "author: admin"

}

Response

The server returns the following response to the client.

Response Codes

A successfully completed operation returns a response code 200 OK.

Response Headers

The response to this request contains the following headers. The response may also include additional standard HTTPS headers.

Header

Description

Content-length

The length of the response body.

Content-type

The media type and syntax of the response body message: application/json; charset=utf-8

Response Body

The response body contains the following properties:

Property

Type

Description

results

Results Object

Contains the Results object.

_links

Dictionary of string [key] and Object [value]

Links to related resources (navigation property).

Results Object

Property

Type

Description

postId

string

ID of the post.

isImportant

boolean

Defines whether the post is marked as important.

author

string

User name of the author of the post.

subject

string

Subject of the post.

createdTime

UTC

Date and time when the post was created.

lastModificationTime

UTC

Date and time of the latest modification of the post.

attachments

object[]

Attachments of the post.

_links

Dictionary of string [key] and Object [value]

Links to related resources (navigation property).

Response Example

Response:

200 OK

 

Response Body:

{

 "offset": 0,

 "limit": 30,

 "results": [

   {

     "postId": 1603973537508,

     "isImportant": false,

     "author": "admin",

     "subject": "announcement",

     "createdTime": "2020-10-29T12:12:17.508Z",

     "lastModifiedTime": "2020-10-29T12:19:59.976Z",

     "attachments": [],

     "_links": {

       "self": {

         "href": "/v6/RestoreSessions/1a4df11a-2220-42a9-b3a0-d25cdb8e5fcb/organization/teams/448c5b66-8dcd-4c75-b636-d3b500bce36f/posts/1603973537508?channelId=19:94e57dbfaa634f999353b374b69b5800@thread.tacv2"

       },

       "channel": {

         "href": "/v6/RestoreSessions/1a4df11a-2220-42a9-b3a0-d25cdb8e5fcb/organization/teams/448c5b66-8dcd-4c75-b636-d3b500bce36f/channels/19:94e57dbfaa634f999353b374b69b5800@thread.tacv2"

       },

       "team": {

         "href": "/v6/RestoreSessions/1a4df11a-2220-42a9-b3a0-d25cdb8e5fcb/organization/teams/448c5b66-8dcd-4c75-b636-d3b500bce36f"

       }

     }

   },

   {

     "postId": 1600943113431,

     "isImportant": false,

     "author": "admin",

     "subject": "",

     "createdTime": "2020-09-24T10:25:13.431Z",

     "lastModifiedTime": "2020-09-24T10:45:16.471Z",

     "attachments": [],

     "_links": {

       "self": {

         "href": "/v6/RestoreSessions/1a4df11a-2220-42a9-b3a0-d25cdb8e5fcb/organization/teams/448c5b66-8dcd-4c75-b636-d3b500bce36f/posts/1600943113431?channelId=19:94e57dbfaa634f999353b374b69b5800@thread.tacv2"

       },

       "channel": {

         "href": "/v6/RestoreSessions/1a4df11a-2220-42a9-b3a0-d25cdb8e5fcb/organization/teams/448c5b66-8dcd-4c75-b636-d3b500bce36f/channels/19:94e57dbfaa634f999353b374b69b5800@thread.tacv2"

       },

       "team": {

         "href": "/v6/RestoreSessions/1a4df11a-2220-42a9-b3a0-d25cdb8e5fcb/organization/teams/448c5b66-8dcd-4c75-b636-d3b500bce36f"

       }

     }

   }

 ],

 "_links": {

   "self": {

     "href": "/v6/RestoreSessions/1a4df11a-2220-42a9-b3a0-d25cdb8e5fcb/organization/teams/448c5b66-8dcd-4c75-b636-d3b500bce36f/posts/search?offset=0&limit=30"

   }

 }

}