tommy

Rendered from docs/openapi-as2.json in the repository.

On this page

tommy as2 API v1

Stands in for a trading partner's AS2 endpoint: it accepts the EDIINT messages your integration posts - signed, encrypted, compressed, in any combination - and answers with the MDN receipt the sender is waiting on, so an AS2 client runs unmodified against a fake. The AS2 tab shows each message unwrapped layer by layer, the EDI document that was inside, the computed MIC and exactly what the signature did and did not prove.

These routes read back what tommy captured, in the shape this content type wants: filters that only mean something here, and the parts that are bytes rather than JSON. They read from the same store as the events API, so a client that sends and immediately fetches sees its own write, and every entry carries the id of the event behind it.

The events API - /api/v1/events, described in its own document - is the generic view of the same captures, and is the one to use when what you are asserting does not depend on the content type. The fake vendor endpoints are described nowhere here: they are the vendors' specifications, not tommy's.

This document is generated from the server's route table. It cannot describe a route that does not exist, and CI fails if the checked-in copy stops matching the code.

Server

  • /api/v1/as2 — This tommy's as2 API.

Operations

GET /certificate Tommy's certificate as PEM, for a trading partner to import.

Responses

StatusBodyDescription
200 application/x-pem-file
Success.
GET /identity Which certificate is in use, where it came from, and its fingerprint.

Responses

StatusBodyDescription
200 application/json · as2.IdentityInfo
Success.
GET /messages Every captured AS2 message, newest first.

Parameters

NameInTypeDescription
provider query string Only entries captured by this provider, such as mailjet.
type query string Only entries of this event type, such as mail.message.
search query string Case-insensitive substring over the summary and type.
since query string RFC3339 timestamp, a duration such as 5m, or unix milliseconds.
limit query integer Maximum number of entries to return.
offset query integer How many entries to skip.
from query string The partner's AS2-From identifier.
to query string The AS2-To identifier the message was addressed to.
message_id query string The AS2 Message-ID.
format query string The business document's format, such as edifact or x12.
security query string Which layers were used: signed, encrypted, compressed.
issue query string Only messages tommy recorded a problem with, such as a signature it could not verify.

Responses

StatusBodyDescription
200 application/json · array of as2.MessageEnvelope
Success.
400 application/json · api.Error
A query parameter could not be parsed - a malformed since, a negative limit.
DELETE /messages Clear every captured AS2 message.

Responses

StatusBodyDescription
204 no body Done. No body.
GET /messages/{id} One message, unwrapped through every layer it arrived in.

Parameters

NameInTypeDescription
id required path string The event id, as returned by any listing.

Responses

StatusBodyDescription
200 application/json · as2.MessageEnvelope
Success.
404 application/json · api.Error
No such resource, or it belongs to another plugin.
DELETE /messages/{id} Delete one captured message.

Parameters

NameInTypeDescription
id required path string The event id, as returned by any listing.

Responses

StatusBodyDescription
204 no body Done. No body.
404 application/json · api.Error
No such resource, or it belongs to another plugin.
GET /messages/{id}/mdn The MDN receipt tommy returned, byte for byte.

Parameters

NameInTypeDescription
id required path string The event id, as returned by any listing.

Responses

StatusBodyDescription
200 text/plain
Success.
404 application/json · api.Error
No such resource, or it belongs to another plugin.
GET /messages/{id}/payload The business document after every layer was peeled.

Parameters

NameInTypeDescription
id required path string The event id, as returned by any listing.

Responses

StatusBodyDescription
200 application/octet-stream
Success.
404 application/json · api.Error
No such resource, or it belongs to another plugin.
GET /messages/{id}/raw The request exactly as it arrived, ciphertext included.

Parameters

NameInTypeDescription
id required path string The event id, as returned by any listing.

Responses

StatusBodyDescription
200 text/plain
Success.
404 application/json · api.Error
No such resource, or it belongs to another plugin.

Schemas

api.Error

PropertyType
error requiredstring

as2.CertInfo

PropertyType
fingerprint requiredstring
issuer requiredstring
key_algorithmstring
not_after requiredstring (date-time)
not_before requiredstring (date-time)
self_signed requiredboolean
serial requiredstring
subject requiredstring

as2.CompressionInfo

PropertyType
algorithmstring
algorithm_oid requiredstring
compressed_size requiredinteger
decompressed requiredboolean
decompressed_sizeinteger
errorstring
placement requiredstring

as2.Encryption

PropertyType
content_algorithmstring
content_algorithm_oidstring
decrypted requiredboolean
errorstring
key_algorithmstring
key_algorithm_oidstring
recipientsarray of as2.RecipientInfo

as2.IdentityInfo

PropertyType
cert_pathstring
certificateas2.CertInfo
configured requiredboolean
errorstring
key_pathstring
partneras2.CertInfo
pemstring
ready requiredboolean
source requiredstring

as2.Issue

PropertyType
code requiredstring
detail requiredstring
severity requiredstring

as2.Layer

PropertyType
bytes requiredinteger
content_typestring
kind requiredstring
opened requiredboolean
smime_typestring

as2.MDNRecord

PropertyType
blobblob.Ref
disposition requiredstring
headersobject of array of string
human_textstring
message_id requiredstring
micalgstring
received_content_micstring
signed requiredboolean
size requiredinteger
status requiredinteger

as2.MIC

PropertyType
algorithm requiredstring
bytes requiredinteger
coverage requiredstring
digest requiredstring
notestring

as2.Message

PropertyType
alternate_micsarray of as2.MIC
as2_versionstring
content_typestring
datestring
from requiredstring
issuesarray of as2.Issue
layersarray of as2.Layer
mdnas2.MDNRecord
message_idstring
micas2.MIC
payload requiredas2.Payload
receipt requiredas2.ReceiptRequest
security requiredas2.Security
subjectstring
to requiredstring
user_agentstring

as2.MessageEnvelope

PropertyType
id requiredstring
mdn_urlstring
message requiredas2.Message
metaobject of any
payload_urlstring
previewstring
provider requiredstring
raw_url requiredstring
received_at requiredstring (date-time)
title requiredstring
type requiredstring
urlstring

as2.Payload

PropertyType
blobblob.Ref
content_typestring
filenamestring
formatstring
previewstring
recoveredboolean
size requiredinteger
transfer_encodingstring

as2.ReceiptRequest

PropertyType
async_urlstring
mic_algsarray of string
notify_tostring
optionsstring
protocolstring
requested requiredboolean
signed_importancestring
signed_requested requiredboolean

as2.RecipientInfo

PropertyType
issuer requiredstring
serial requiredstring

as2.Security

PropertyType
compressed requiredboolean
compressionas2.CompressionInfo
encrypted requiredboolean
encryptionas2.Encryption
signatureas2.Signature
signed requiredboolean

as2.Signature

PropertyType
chainarray of as2.CertInfo
declared_micalgstring
digest_algorithmstring
errorstring
partner_configured requiredboolean
protocolstring
signature_algorithmstring
signeras2.CertInfo
signer_matched requiredboolean
verified requiredboolean

blob.Ref

PropertyType
content_typestring
filenamestring
id requiredstring
size requiredinteger