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
| Status | Body | Description |
200 |
application/x-pem-file
|
Success. |
GET
/identity
Which certificate is in use, where it came from, and its fingerprint.
GET
/messages
Every captured AS2 message, newest first.
Parameters
| Name | In | Type | Description |
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
| Status | Body | Description |
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
| Status | Body | Description |
204 |
no body |
Done. No body. |
GET
/messages/{id}
One message, unwrapped through every layer it arrived in.
Parameters
| Name | In | Type | Description |
id required |
path |
string |
The event id, as returned by any listing. |
Responses
| Status | Body | Description |
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
| Name | In | Type | Description |
id required |
path |
string |
The event id, as returned by any listing. |
Responses
| Status | Body | Description |
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
| Name | In | Type | Description |
id required |
path |
string |
The event id, as returned by any listing. |
Responses
| Status | Body | Description |
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
| Name | In | Type | Description |
id required |
path |
string |
The event id, as returned by any listing. |
Responses
| Status | Body | Description |
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
| Name | In | Type | Description |
id required |
path |
string |
The event id, as returned by any listing. |
Responses
| Status | Body | Description |
200 |
text/plain
|
Success. |
404 |
application/json · api.Error
|
No such resource, or it belongs to another plugin. |
Schemas
api.Error
| Property | Type |
error required | string |
as2.CertInfo
| Property | Type |
fingerprint required | string |
issuer required | string |
key_algorithm | string |
not_after required | string (date-time) |
not_before required | string (date-time) |
self_signed required | boolean |
serial required | string |
subject required | string |
as2.CompressionInfo
| Property | Type |
algorithm | string |
algorithm_oid required | string |
compressed_size required | integer |
decompressed required | boolean |
decompressed_size | integer |
error | string |
placement required | string |
as2.Encryption
| Property | Type |
content_algorithm | string |
content_algorithm_oid | string |
decrypted required | boolean |
error | string |
key_algorithm | string |
key_algorithm_oid | string |
recipients | array of as2.RecipientInfo |
as2.IdentityInfo
| Property | Type |
cert_path | string |
certificate | as2.CertInfo |
configured required | boolean |
error | string |
key_path | string |
partner | as2.CertInfo |
pem | string |
ready required | boolean |
source required | string |
as2.Issue
| Property | Type |
code required | string |
detail required | string |
severity required | string |
as2.Layer
| Property | Type |
bytes required | integer |
content_type | string |
kind required | string |
opened required | boolean |
smime_type | string |
as2.MDNRecord
| Property | Type |
blob | blob.Ref |
disposition required | string |
headers | object of array of string |
human_text | string |
message_id required | string |
micalg | string |
received_content_mic | string |
signed required | boolean |
size required | integer |
status required | integer |
as2.MIC
| Property | Type |
algorithm required | string |
bytes required | integer |
coverage required | string |
digest required | string |
note | string |
as2.MessageEnvelope
| Property | Type |
id required | string |
mdn_url | string |
message required | as2.Message |
meta | object of any |
payload_url | string |
preview | string |
provider required | string |
raw_url required | string |
received_at required | string (date-time) |
title required | string |
type required | string |
url | string |
as2.Payload
| Property | Type |
blob | blob.Ref |
content_type | string |
filename | string |
format | string |
preview | string |
recovered | boolean |
size required | integer |
transfer_encoding | string |
as2.ReceiptRequest
| Property | Type |
async_url | string |
mic_algs | array of string |
notify_to | string |
options | string |
protocol | string |
requested required | boolean |
signed_importance | string |
signed_requested required | boolean |
as2.RecipientInfo
| Property | Type |
issuer required | string |
serial required | string |
as2.Signature
| Property | Type |
chain | array of as2.CertInfo |
declared_micalg | string |
digest_algorithm | string |
error | string |
partner_configured required | boolean |
protocol | string |
signature_algorithm | string |
signer | as2.CertInfo |
signer_matched required | boolean |
verified required | boolean |
blob.Ref
| Property | Type |
content_type | string |
filename | string |
id required | string |
size required | integer |