From 2ffffb65a3bf98f02d0668c441ef3e1a962a06ff Mon Sep 17 00:00:00 2001 From: neverett8fr Date: Tue, 25 Jul 2023 21:44:48 +0100 Subject: [PATCH 1/7] add list of endpoints section in README (addresses) --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 479687b..98859d8 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,17 @@ Once we're authenticated and our tokens are valid, we can make api calls to vari proton_session.api_request(endpoint="custom_api_endpoint") ``` +### List of endpoints + +- `https://mail.proton.me/api`: the current base URL for APIs _this may change in future_ +- `/core/v4` + - `/addresses GET`: Get addresses + - `/addresses/{{address_id}} GET`: Get address + - `/addresses/order PUT`: Order addresses + - `/addresses/{{address_id}}/enable PUT`: Enable address + - `/addresses/{{address_id}}/disable PUT`: Disable address + - `/addresses/{{address_id}} DELETE`: Delete address + ## Error handling For all of commands presented in the previous chapters, it is recommended to use them within try/except blocks. Some common errors that might come up: - `401`: Invalid `AccessToken`, client should refresh tokens ([Refresh Session](#refresh-session)) From 3fa950556203c18d2c72a2a08df7357d577ba1f1 Mon Sep 17 00:00:00 2001 From: neverett8fr Date: Tue, 25 Jul 2023 21:48:21 +0100 Subject: [PATCH 2/7] README - add mail endpoint --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 98859d8..a99670e 100644 --- a/README.md +++ b/README.md @@ -142,6 +142,9 @@ proton_session.api_request(endpoint="custom_api_endpoint") - `/addresses/{{address_id}}/enable PUT`: Enable address - `/addresses/{{address_id}}/disable PUT`: Disable address - `/addresses/{{address_id}} DELETE`: Delete address +- `/mail/v4` + - `/attachments POST`: Upload attachment + - `/attachments/{{attachment_id}} GET`: Get attachment ## Error handling For all of commands presented in the previous chapters, it is recommended to use them within try/except blocks. Some common errors that might come up: From 090913122d0e3f326e508e013c084adf8fe6188b Mon Sep 17 00:00:00 2001 From: neverett8fr Date: Tue, 25 Jul 2023 21:53:48 +0100 Subject: [PATCH 3/7] README add auth --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index a99670e..4e63247 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,12 @@ proton_session.api_request(endpoint="custom_api_endpoint") - `/mail/v4` - `/attachments POST`: Upload attachment - `/attachments/{{attachment_id}} GET`: Get attachment +- `/auth/v4` + - `/2fa POST`: Auth 2FA + - `/ DELETE`: Auth delete + - `/sessions GET`: Auth sessions + - `/sessions/{{auth_uid}} DELETE`: Auth revoke + - `/sessions DELETE`: Auth revoke all ## Error handling For all of commands presented in the previous chapters, it is recommended to use them within try/except blocks. Some common errors that might come up: From 1bea927b698e465336038188b2c2621cc5ac31cb Mon Sep 17 00:00:00 2001 From: neverett8fr Date: Tue, 25 Jul 2023 21:58:09 +0100 Subject: [PATCH 4/7] README add calendar --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 4e63247..4a5f6dc 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,10 @@ proton_session.api_request(endpoint="custom_api_endpoint") - `/sessions GET`: Auth sessions - `/sessions/{{auth_uid}} DELETE`: Auth revoke - `/sessions DELETE`: Auth revoke all +- `/calendar/v1` + - `/{{calendar_id}}/events GET`: Calendar events + - `/ GET`: Get calendars + - `/{{calendar_id}} GET`: Get calendar ## Error handling For all of commands presented in the previous chapters, it is recommended to use them within try/except blocks. Some common errors that might come up: From 9e79e933d9c30bd40390d458ad13ccd77980a64f Mon Sep 17 00:00:00 2001 From: neverett8fr Date: Tue, 25 Jul 2023 22:06:39 +0100 Subject: [PATCH 5/7] README add messages endpoint, etc. --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 4a5f6dc..aa8ad05 100644 --- a/README.md +++ b/README.md @@ -151,10 +151,21 @@ proton_session.api_request(endpoint="custom_api_endpoint") - `/sessions GET`: Auth sessions - `/sessions/{{auth_uid}} DELETE`: Auth revoke - `/sessions DELETE`: Auth revoke all + - `/refresh POST`: Auth refresh - `/calendar/v1` - `/{{calendar_id}}/events GET`: Calendar events - `/ GET`: Get calendars - `/{{calendar_id}} GET`: Get calendar +- `/contacts/v4` +- `/data/v1` +- `/drive` +- `/mail/v4` + - `/settings GET`: Get mail settings + - `/settings/display PUT`: Set display name + - `/messages/import POST`: Import messages + - `/messages POST`: Create draft + - `/messages/{{draft_id}} PUT`: Update draft + - `/messages/{{draft_id}} POST`: Send draft ## Error handling For all of commands presented in the previous chapters, it is recommended to use them within try/except blocks. Some common errors that might come up: From fd546ef0189fd1b080838eb2c1b8c4ab0596e616 Mon Sep 17 00:00:00 2001 From: neverett8fr Date: Tue, 25 Jul 2023 22:12:12 +0100 Subject: [PATCH 6/7] README add some messages --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index aa8ad05..cad7213 100644 --- a/README.md +++ b/README.md @@ -166,6 +166,11 @@ proton_session.api_request(endpoint="custom_api_endpoint") - `/messages POST`: Create draft - `/messages/{{draft_id}} PUT`: Update draft - `/messages/{{draft_id}} POST`: Send draft + - `/messages/{{message_id}} GET`: Get message + - `/messages/delete PUT`: Delete message + - `/messages/read PUT`: Mark message as read + - `/messages/unread PUT`: Mark message as unread + - `/messages/ids GET`: Get message IDs ## Error handling For all of commands presented in the previous chapters, it is recommended to use them within try/except blocks. Some common errors that might come up: From da3e830aaaac1def808b20d6b96812cbe4bed6da Mon Sep 17 00:00:00 2001 From: neverett8fr Date: Tue, 25 Jul 2023 22:33:55 +0100 Subject: [PATCH 7/7] cleanup of README API section --- README.md | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index cad7213..cfb7042 100644 --- a/README.md +++ b/README.md @@ -145,23 +145,7 @@ proton_session.api_request(endpoint="custom_api_endpoint") - `/mail/v4` - `/attachments POST`: Upload attachment - `/attachments/{{attachment_id}} GET`: Get attachment -- `/auth/v4` - - `/2fa POST`: Auth 2FA - - `/ DELETE`: Auth delete - - `/sessions GET`: Auth sessions - - `/sessions/{{auth_uid}} DELETE`: Auth revoke - - `/sessions DELETE`: Auth revoke all - - `/refresh POST`: Auth refresh -- `/calendar/v1` - - `/{{calendar_id}}/events GET`: Calendar events - - `/ GET`: Get calendars - - `/{{calendar_id}} GET`: Get calendar -- `/contacts/v4` -- `/data/v1` -- `/drive` -- `/mail/v4` - `/settings GET`: Get mail settings - - `/settings/display PUT`: Set display name - `/messages/import POST`: Import messages - `/messages POST`: Create draft - `/messages/{{draft_id}} PUT`: Update draft @@ -171,6 +155,24 @@ proton_session.api_request(endpoint="custom_api_endpoint") - `/messages/read PUT`: Mark message as read - `/messages/unread PUT`: Mark message as unread - `/messages/ids GET`: Get message IDs +- `/auth/v4` + - `/ POST`: Post auth + - `/info POST`: Post auth info + - `/refresh POST`: Post auth refresh + - `/ DELETE`: Auth delete + - `/sessions GET`: Auth sessions + - `/sessions DELETE`: Auth revoke all + - `/sessions/{{auth_uid}} DELETE`: Auth revoke +- `/calendar/v1` + - `/{{calendar_id}}/events GET`: Calendar events + - `/ GET`: Get calendars + - `/{{calendar_id}} GET`: Get calendar +- `/contacts/v4` + - `/emails GET`: Get contacts emails +- `/data/v1` + - `/stats POST`: Post data stats + - `/stats/multiple POST`: Post multiple data stats + ## Error handling For all of commands presented in the previous chapters, it is recommended to use them within try/except blocks. Some common errors that might come up: