Created
March 30, 2024 10:18
-
-
Save timd/d34be1cfee9efb17723cfdd3786291e1 to your computer and use it in GitHub Desktop.
Postman definitions for Fastmail JMAP - see https://trashpanda.cc/2024/03/interacting-with-a-jmap-api-a-rapid-start/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"info": { | |
"name": "Fastmail JMAP", | |
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | |
}, | |
"item": [ | |
{ | |
"name": "Fastmail JMAP", | |
"item": [ | |
{ | |
"name": "Get folders", | |
"event": [], | |
"request": { | |
"method": "POST", | |
"header": [ | |
{ | |
"key": "Authorization", | |
"value": "{{fastmailAuth}}", | |
"disabled": false, | |
"type": "default" | |
} | |
], | |
"url": "https://api.fastmail.com/jmap/api/", | |
"body": { | |
"mode": "raw", | |
"raw": "{\n \"using\": [\n \"urn:ietf:params:jmap:core\",\n \"urn:ietf:params:jmap:mail\"\n ],\n \"methodCalls\": [\n [\n \"Mailbox/get\",\n {\n \"accountId\": \"{{accountId}}\",\n \"ids\": null\n },\n \"abc\"\n ]\n ]\n}", | |
"options": { | |
"raw": { | |
"language": "json" | |
} | |
} | |
} | |
} | |
}, | |
{ | |
"name": "GET account details", | |
"event": [], | |
"request": { | |
"method": "GET", | |
"header": [ | |
{ | |
"key": "Authorization", | |
"value": "{{fastmailAuth}}", | |
"disabled": false, | |
"type": "default" | |
} | |
], | |
"url": "https://api.fastmail.com/.well-known/jmap", | |
"body": { | |
"mode": "raw", | |
"options": { | |
"raw": { | |
"language": "json" | |
} | |
} | |
} | |
} | |
}, | |
{ | |
"name": "Get folder contents", | |
"event": [], | |
"request": { | |
"method": "POST", | |
"header": [ | |
{ | |
"key": "Authorization", | |
"value": "{{fastmailAuth}}", | |
"disabled": false, | |
"type": "default" | |
} | |
], | |
"url": "https://api.fastmail.com/jmap/api/", | |
"body": { | |
"mode": "raw", | |
"raw": "{\n \"using\": [\n \"urn:ietf:params:jmap:core\",\n \"urn:ietf:params:jmap:mail\"\n ],\n \"methodCalls\": [\n [\n \"Email/query\",\n {\n \"accountId\": \"{{accountId}}\",\n \"filter\": {\n \"inMailbox\": \"{{mailboxId}}\"\n },\n \"sort\": [\n {\n \"property\": \"receivedAt\",\n \"isAscending\": false\n }\n ],\n \"limit\": 500\n },\n \"a\"\n ]\n ]\n}", | |
"options": { | |
"raw": { | |
"language": "json" | |
} | |
} | |
} | |
} | |
}, | |
{ | |
"name": "Get specific email", | |
"event": [], | |
"request": { | |
"method": "POST", | |
"header": [ | |
{ | |
"key": "Authorization", | |
"value": "{{fastmailAuth}}", | |
"disabled": false, | |
"type": "default" | |
} | |
], | |
"url": "https://api.fastmail.com/jmap/api/", | |
"body": { | |
"mode": "raw", | |
"raw": "{\n \"using\": [\n \"urn:ietf:params:jmap:core\",\n \"urn:ietf:params:jmap:mail\"\n ],\n \"methodCalls\": [\n [\n \"Email/get\",\n {\n \"accountId\": \"{{accountId}}\",\n \"properties\": null,\n \"ids\": [\n \"{{mailId}}\"\n ]\n },\n \"a\"\n ]\n ]\n}\n", | |
"options": { | |
"raw": { | |
"language": "json" | |
} | |
} | |
} | |
} | |
}, | |
{ | |
"name": "Get email blob", | |
"event": [], | |
"request": { | |
"method": "GET", | |
"header": [ | |
{ | |
"key": "Authorization", | |
"value": "{{fastmailAuth}}", | |
"disabled": false, | |
"type": "default" | |
} | |
], | |
"url": "https://www.fastmailusercontent.com/jmap/download/accountID/blobId/name?type=application/html", | |
"body": { | |
"mode": "raw", | |
"raw": "{\n \"using\": [\n \"urn:ietf:params:jmap:core\",\n \"urn:ietf:params:jmap:mail\"\n ],\n \"methodCalls\": [\n [\n \"Email/get\",\n {\n \"accountId\": \"{{accountId}}\",\n \"properties\": null,\n \"ids\": [\n \"{{blobId}}\"\n ]\n },\n \"a\"\n ]\n ]\n}\n", | |
"options": { | |
"raw": { | |
"language": "json" | |
} | |
} | |
} | |
} | |
}, | |
{ | |
"name": "Query specific email", | |
"event": [], | |
"request": { | |
"method": "POST", | |
"header": [ | |
{ | |
"key": "Authorization", | |
"value": "{{fastmailAuth}}", | |
"disabled": false, | |
"type": "default" | |
} | |
], | |
"url": "https://api.fastmail.com/jmap/api/", | |
"body": { | |
"mode": "raw", | |
"raw": "{\n \"using\": [\n \"urn:ietf:params:jmap:core\",\n \"urn:ietf:params:jmap:mail\"\n ],\n \"methodCalls\": [\n [\n \"Email/query\",\n {\n \"accountId\": \"{{accountId}}\",\n \"filter\": {\n \"ids\": [\"{{mailId}}\"]\n },\n \"sort\": [\n {\n \"property\": \"receivedAt\",\n \"isAscending\": false\n }\n ],\n \"limit\": 500\n },\n \"a\"\n ]\n ]\n}", | |
"options": { | |
"raw": { | |
"language": "json" | |
} | |
} | |
} | |
} | |
} | |
] | |
} | |
], | |
"variable": [ | |
{ | |
"key": "host", | |
"value": "", | |
"type": "default" | |
}, | |
{ | |
"key": "fastmailAuth", | |
"value": "", | |
"type": "default" | |
}, | |
{ | |
"key": "accountId", | |
"value": "", | |
"type": "default" | |
}, | |
{ | |
"key": "emailId", | |
"value": "", | |
"type": "default" | |
}, | |
{ | |
"key": "blobId", | |
"value": "", | |
"type": "default" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment