# Query certified SMS messages (GET)

Endpoint: GET /v1/EviSms/Query
Version: 1.0
Security: basicAuth

## Security:

  - `basicAuth` (unknown)
    http basic

## Query parameters:

  - `WithUniqueIds` (string)

  - `WithLookupKeys` (string)

  - `WithLinkedId` (string)
    Filter by linked ID. Leave affidavit and attachment data disabled. The legacy implementation uses deployment settings for omitted blob flags, with both defaults declared enabled. On legacy deployments, explicitly send IncludeAffidavitBlobs=false and IncludeAttachmentBlobs=false. The attachment flag applies only to legacy Query.

  - `OnState` (string)
    Filters results by the current EviSMS state. `Replied` is not part of the current public EviSMS lifecycle.

  - `WithOutcome` (string)

  - `OrderResultsBy` (string)

  - `Limit` (integer)
    Default and maximum are 100 for messages alone, 25 with affidavit metadata, and 1 with affidavit blobs.

  - `Offset` (integer)

  - `IncludeAffidavits` (boolean)
    Include affidavit entries. Set IncludeAffidavitBlobs to false for metadata-only results.

  - `IncludeAffidavitBlobs` (boolean)
    When true with IncludeAffidavits, returns Base64 PDFs and limits the query to one message. ASP.NET defaults to false. Legacy uses a deployment setting whose declared default is true. Set false explicitly for metadata-only results and use /AffidavitsDownload for PDFs.

## Response 200:

  - `200` (unknown)
    Query executed successfully

## Response 200 fields (application/json):

  - `totalMatches` (integer)

  - `results` (array)

  - `results.uniqueId` (string)
    Unique identifier (EviId) of the certified SMS.

  - `results.lookupKey` (string)
    Locator assigned by the issuer at submission.

  - `results.text` (string)
    Content of the SMS message.

  - `results.issuer` (object)

  - `results.issuer.legalName` (string)

  - `results.issuer.phoneNumber` (string)

  - `results.recipient` (object)

  - `results.recipient.legalName` (string)

  - `results.recipient.phoneNumber` (string)

  - `results.state` (string)
    Enum: "Draft", "New", "Ready", "Sent", "Dispatched", "Delivered", "Read", "Closed", "Failed"

  - `results.outcome` (string)
    Enum: "None", "Certified", "Sent", "Delivered", "Read", "Failed"

  - `results.creationDate` (string)

  - `results.lastStateChangeDate` (string)

  - `results.newOn` (string)

  - `results.readyOn` (string)
    Set when Ready is recorded, with the original admission time from newOn.

  - `results.sentOn` (string)

  - `results.dispatchedOn` (string)

  - `results.deliveredOn` (string)

  - `results.readOn` (string)

  - `results.failedOn` (string)

  - `results.expiredOn` (string)

  - `results.timeToLive` (integer)
    Minutes before the message tracking closes.

  - `results.costCentre` (string)
    Cost-centre label recorded with the transaction for internal billing allocation.

  - `results.onlineRetentionPeriod` (integer)
    Years of online retention.

  - `results.notaryRetentionPeriod` (integer)
    Years of retention at the notary office.

  - `results.notaryProfile` (string)
    Notary identifier for custody.

  - `results.sourceChannel` (string)
    Enum: "Web", "Api", "Smtp"

  - `results.deliveryChannels` (array)
    Channels used to deliver the SMS (e.g., RCS, SMS).

  - `results.affidavitKinds` (array)

  - `results.affidavits` (array)
    Affidavit entries. Bytes are present if affidavit blobs are enabled for the request.

  - `results.affidavits.uniqueId` (string)
    Unique identifier of the affidavit.

  - `results.affidavits.date` (string)
    Timestamp when the affidavit was generated.

  - `results.affidavits.evidenceUniqueId` (string)
    Unique identifier of the SMS this affidavit belongs to.

  - `results.affidavits.partyUniqueId` (string)
    Identifier of the related delivery/party, when applicable.

  - `results.affidavits.bytes` (string)
    Base64-encoded affidavit PDF. Present when the effective IncludeAffidavitBlobs value is true.

  - `results.affidavits.description` (string)
    Human-readable description of the affidavit.

  - `results.affidavits.kind` (string)
    Technical identifier of the affidavit kind, for example EviSms:Closed.

  - `results.affidavits.additionalData` (object)
    Additional affidavit metadata as key-value pairs.

## Response 401:

  - `401` (unknown)
    Authentication failed

