# List messages GET https://api2.freecustom.email/v1/inboxes/{inbox}/messages Reference: https://docs.freecustom.email/free-custom-email-api/v-1/inboxes/inbox/messages/list-messages ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: collection version: 1.0.0 paths: /v1/inboxes/{inbox}/messages: get: operationId: list-messages summary: List messages tags: - >- subpackage_v1.subpackage_v1/inboxes.subpackage_v1/inboxes/inbox.subpackage_v1/inboxes/inbox/messages parameters: - name: inbox in: path required: true schema: type: string - name: limit in: query required: false schema: type: integer - name: before in: query description: Message ID — returns messages older than this required: false schema: type: string - name: Authorization in: header description: Bearer authentication required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: >- #/components/schemas/v1_inboxes_{inbox}_messages_List messages_Response_200 '401': description: Unauthorized content: application/json: schema: $ref: >- #/components/schemas/GetV1InboxesInboxMessagesRequestUnauthorizedError '403': description: Forbidden content: application/json: schema: $ref: >- #/components/schemas/GetV1InboxesInboxMessagesRequestForbiddenError '429': description: Too Many Requests content: application/json: schema: $ref: >- #/components/schemas/GetV1InboxesInboxMessagesRequestTooManyRequestsError servers: - url: https://api2.freecustom.email components: schemas: V1InboxesInboxMessagesGetResponsesContentApplicationJsonSchemaDataMessagesItems: type: object properties: id: type: string otp: type: string date: type: string format: date-time from: type: string subject: type: string has_attachment: type: boolean verification_link: type: string required: - id - otp - date - from - subject - has_attachment - verification_link title: >- V1InboxesInboxMessagesGetResponsesContentApplicationJsonSchemaDataMessagesItems V1InboxesInboxMessagesGetResponsesContentApplicationJsonSchemaData: type: object properties: count: type: integer inbox: type: string has_more: type: boolean messages: type: array items: $ref: >- #/components/schemas/V1InboxesInboxMessagesGetResponsesContentApplicationJsonSchemaDataMessagesItems required: - count - inbox - has_more - messages title: V1InboxesInboxMessagesGetResponsesContentApplicationJsonSchemaData v1_inboxes_{inbox}_messages_List messages_Response_200: type: object properties: data: $ref: >- #/components/schemas/V1InboxesInboxMessagesGetResponsesContentApplicationJsonSchemaData success: type: boolean required: - data - success title: v1_inboxes_{inbox}_messages_List messages_Response_200 GetV1InboxesInboxMessagesRequestUnauthorizedError: type: object properties: error: type: string message: type: string success: type: boolean required: - error - message - success title: GetV1InboxesInboxMessagesRequestUnauthorizedError GetV1InboxesInboxMessagesRequestForbiddenError: type: object properties: error: type: string message: type: string success: type: boolean required: - error - message - success title: GetV1InboxesInboxMessagesRequestForbiddenError GetV1InboxesInboxMessagesRequestTooManyRequestsError: type: object properties: hint: type: string error: type: string message: type: string success: type: boolean credits_url: type: string format: uri upgrade_url: type: string format: uri required: - hint - error - message - success - credits_url - upgrade_url title: GetV1InboxesInboxMessagesRequestTooManyRequestsError securitySchemes: bearerAuth: type: http scheme: bearer ``` ## SDK Code Examples ```python v1_inboxes_{inbox}_messages_List messages_example import requests url = "https://api2.freecustom.email/v1/inboxes/string/messages" querystring = {"limit":"20","before":"string"} headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers, params=querystring) print(response.json()) ``` ```javascript v1_inboxes_{inbox}_messages_List messages_example const url = 'https://api2.freecustom.email/v1/inboxes/string/messages?limit=20&before=string'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go v1_inboxes_{inbox}_messages_List messages_example package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api2.freecustom.email/v1/inboxes/string/messages?limit=20&before=string" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby v1_inboxes_{inbox}_messages_List messages_example require 'uri' require 'net/http' url = URI("https://api2.freecustom.email/v1/inboxes/string/messages?limit=20&before=string") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java v1_inboxes_{inbox}_messages_List messages_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api2.freecustom.email/v1/inboxes/string/messages?limit=20&before=string") .header("Authorization", "Bearer ") .asString(); ``` ```php v1_inboxes_{inbox}_messages_List messages_example request('GET', 'https://api2.freecustom.email/v1/inboxes/string/messages?limit=20&before=string', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp v1_inboxes_{inbox}_messages_List messages_example using RestSharp; var client = new RestClient("https://api2.freecustom.email/v1/inboxes/string/messages?limit=20&before=string"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift v1_inboxes_{inbox}_messages_List messages_example import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api2.freecustom.email/v1/inboxes/string/messages?limit=20&before=string")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```