# Method: projects.messages.list

Lists the Messages of the specified project. List returns Messages sorted by create_time descending.

The caller must have `messaging.messages.list` permission on the project.

### HTTP request

`GET https://messaging.api.enfonica.com/v1/{parent}/messages`

### Path parameters

Parameters | &nbsp;
--|--
<span class="e-code">parent</span> | <span class="e-code">string</span><br/>The resource name of the parent of which to list messages. Must be of the form `projects/*`.

### Query parameters
Parameters | &nbsp;
--|--
<span class="e-code">pageSize</span> | <span class="e-code">number (<a href="https://developers.google.com/protocol-buffers/docs/proto3#json" target="_blank">int32</a> format)</span><br/>The maximum number of Messages to return in the response. Default value is 10 and maximum value is 100.
<span class="e-code">pageToken</span> | <span class="e-code">string</span><br/>A pagination token returned from a previous call to `ListMessages` that indicates where this listing should continue from.
<span class="e-code">filter</span> | <span class="e-code">string</span><br/>Filter string to specify which results should be returned.<br/><br/>The following fields can be filtered: - `createTime` - `to` - `from` - `status` - `direction` - `encoding`<br/><br/>For example: createTime >= '2021-01-01T06:00:00.0Z' AND createTime < '2021-02-01' AND status = DELIVERED OR status = UNDELIVERED AND to = '+61*' OR from = '+61*'<br/><br/>Note that OR has higher precendence than AND.

### Request body

The request body must be empty.

### Response body

The ListMessages response message.

<div class="highlight"><span class="filename">JSON representation</span><pre><code><span class="p">{</span>
  <span class="s2">&quot;messages&quot;</span><span class="p">: </span><span class="p">[</span>
    <span class="p">{</span>
      <span class="kd">object (</span><a href="/docs/cloud-sms/api-reference/rest/v1/projects.messages/overview/#resource-message"><strong><span class="kd">Message</span></strong></a><span class="kd">)</span>
    <span class="p">}</span>
  <span class="p">]</span><span class="p">,</span>
  <span class="s2">&quot;nextPageToken&quot;</span><span class="p">: </span><span class="kd">string</span>
<span class="p">}</span></code></pre></div>

Fields | &nbsp;
--|--
<span class="e-code">messages[]</span> | <span class="e-code">object ([Message](/docs/cloud-sms/api-reference/rest/v1/projects.messages/overview/#resource-message))</span><br/>A possibly paginated list of Messages that are direct descendants of the specified parent resource.
<span class="e-code">nextPageToken</span> | <span class="e-code">string</span><br/>If this is set, it indicates there are additional results and contains the token to retrieve the next page of results. To use this, pass it in the `page_token` field when calling `ListMessages`.

