> ## Documentation Index
> Fetch the complete documentation index at: https://docs.didit.me/llms.txt
> Use this file to discover all available pages before exploring further.

# 列出 Travel Rule 消息 API

> 通过 Didit 读取与交易对手 VASP 就某笔 Travel Rule 转账交换的消息和证件请求。

列出 Travel Rule 消息的 API 提示
将提示词复制到剪贴板

<pre>
  \`Read the messages and document requests exchanged with the counterparty VASP about one Travel Rule transfer.

  Endpoint:
  GET [https://verification.didit.me/v3/transactions/\{transaction\_id}/travel-rule/messages/](https://verification.didit.me/v3/transactions/\{transaction_id}/travel-rule/messages/)

  Authentication:
  Use the x-api-key header with my Didit API key. {transaction_id} is the Didit transaction uuid on my application.

  What to read from the response:

  * A plain array, oldest first. Each message has id, kind (MESSAGE or DOCUMENT\_REQUEST), direction (OUTBOUND is what my side sent), author, body, requested\_documents, reply\_to, fulfilled\_at (set once a reply carries a document), attachment and created\_at.
  * attachment.files\[].file\_url is a time-limited download URL.

  Failure modes:

  * 404 - unknown transaction, or no Travel Rule transfer on it.

  Send one with POST on the same path. No webhook fires when the counterparty writes, so read this endpoint.

  Full guide: /transaction-monitoring/travel-rule#messages-and-document-requests.\`
</pre>

粘贴到


## OpenAPI

````yaml zh/openapi-25.json GET /v3/transactions/{transaction_id}/travel-rule/messages/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: 身份证件验证 API。使用 x-api-key 请求头进行身份验证。
servers:
  - url: https://verification.didit.me
security: []
tags: []
paths:
  /v3/transactions/{transaction_id}/travel-rule/messages/:
    get:
      tags:
        - Travel Rule
      summary: 列出 Travel Rule 消息
      description: 与交易对手 VASP 就此笔转账交换的消息和证件请求。
      operationId: listTravelRuleMessages
      parameters:
        - name: transaction_id
          in: path
          required: true
          description: 拥有该转账的 Didit 稳定交易 UUID。
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: 消息列表，按时间从旧到新排序。
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TravelRuleMessage'
        '404':
          description: 未知的交易或 token，或者该交易没有 Travel Rule 转账。
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl -X GET
            https://verification.didit.me/v3/transactions/{transaction_id}/travel-rule/messages/
            \
              -H 'x-api-key: YOUR_API_KEY'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.transactions.travel_rule.list_messages(
                "11111111-2222-3333-4444-555555555555",
            )
            print(result)
        - lang: javascript
          label: Node.js
          source: >-
            import Didit from "@didit-protocol/sdk-node";


            // Reads DIDIT_API_KEY.

            const didit = new Didit();


            const result = await
            didit.transactions.travelRule.listMessages("11111111-2222-3333-4444-555555555555");

            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Transactions.TravelRule.ListMessages(ctx, \"11111111-2222-3333-4444-555555555555\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import me.didit.Didit;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.transactions().travelRule().listMessages("11111111-2222-3333-4444-555555555555");

            System.out.println(result);
        - lang: php
          label: PHP
          source: >-
            <?php


            require 'vendor/autoload.php';


            use Didit\DiditClient;


            // Reads DIDIT_API_KEY.

            $didit = new DiditClient();


            $result =
            $didit->transactions->travelRule->listMessages('11111111-2222-3333-4444-555555555555');

            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: >-
            require "didit"


            # Reads DIDIT_API_KEY.

            didit = Didit::Client.new


            didit.transactions.travel_rule.list_messages("11111111-2222-3333-4444-555555555555").each
            do |item|
              puts item.to_h
            end
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using System.Text.Json;

            using Didit;


            // Reads DIDIT_API_KEY.

            using var client = new DiditClient();


            var result = await
            client.Transactions.TravelRule.ListMessagesAsync("11111111-2222-3333-4444-555555555555");

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    TravelRuleMessage:
      type: object
      properties:
        id:
          type: string
          format: uuid
        kind:
          type: string
          enum:
            - MESSAGE
            - DOCUMENT_REQUEST
        direction:
          type: string
          enum:
            - INBOUND
            - OUTBOUND
          description: '`OUTBOUND` 是读取方自身发送的内容。在 pickup 门户中，方向是来自交易对手一方。'
        author:
          type: string
          description: 在其所属方写入该内容的主体：控制台用户的邮箱、API 密钥标签，或对方 VASP 的名称。
        body:
          type: string
        requested_documents:
          type: array
          items:
            type: string
          description: DOCUMENT_REQUEST 所请求的内容，以请求者的措辞描述。
        reply_to:
          type: string
          format: uuid
          nullable: true
        fulfilled_at:
          type: string
          format: date-time
          nullable: true
          description: 一旦对 DOCUMENT_REQUEST 的回复携带了证件，便会在该请求上设置。
        attachment:
          $ref: '#/components/schemas/TravelRuleMessageAttachment'
        created_at:
          type: string
          format: date-time
    TravelRuleMessageAttachment:
      type: object
      nullable: true
      description: 附加到消息的证件，像任何其他交易证件一样存储。
      properties:
        uuid:
          type: string
          format: uuid
        label:
          type: string
          nullable: true
        note:
          type: string
          nullable: true
        uploaded_by:
          type: string
          nullable: true
          description: 附加该文件的主体。在提取门户中，您发送的文件会显示您的 VASP 名称，绝不会显示其背后的个人或 API 密钥。
        created_at:
          type: string
          format: date-time
        files:
          type: array
          items:
            type: object
            properties:
              uuid:
                type: string
                format: uuid
              file_url:
                type: string
                nullable: true
                description: 有时限的下载 URL。
              original_filename:
                type: string
              file_size:
                type: integer
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        您的应用 API 密钥，可在 Business Console 的“开发者 -> API
        密钥”中获取。主密钥拥有完整访问权限。指定名称的密钥可设置作用域：针对每个资源设为无权限、只读或读写，限定于特定工作流或已通过的会话、限定于
        IP 地址列表，以及设置到期日期。401 表示密钥错误、已撤销或已过期；403 表示未发送密钥、密钥无权访问该资源或操作，或请求来自其 IP
        列表之外的地址；在会话路由上返回 404 表示该会话不在该密钥允许的工作流或状态范围内。没有媒体访问权限的密钥获取到的图片、视频和 PDF
        URL 将为 null；没有会话写入权限的密钥获取到的会话链接和 token 将为 null。请参阅
        https://docs.didit.me/console/api-keys。

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.