Skip to content

Commit c8503ab

Browse files
author
Atanas Damyanliev
authored
Merge pull request #32 from mailjet/patch_readme
add versioning section
2 parents 9a7bc41 + 6308175 commit c8503ab

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

README.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
![alt text](https://www.mailjet.com/images/email/transac/logo_header.png "Mailjet")
2-
3-
# Simple Mailjet APIv3 Python Wrapper
4-
1+
[api_credential]: https://app.mailjet.com/account/api_keys
52
[doc]: http://dev.mailjet.com/guides/?python#
63
[api_doc]: https://github.com/mailjet/api-documentation
4+
[smsDashboard]: https://app.mailjet.com/sms?_ga=2.81581655.1972348350.1522654521-1279766791.1506937572
5+
[smsInfo]: https://app.mailjet.com/docs/transactional-sms?_ga=2.183303910.1972348350.1522654521-1279766791.1506937572#trans-sms-token
6+
7+
![alt text](https://www.mailjet.com/images/email/transac/logo_header.png "Mailjet")
8+
9+
# Official Mailjet Python Wrapper
710

811
[![Build Status](https://travis-ci.org/mailjet/mailjet-apiv3-python.svg?branch=master)](https://travis-ci.org/mailjet/mailjet-apiv3-python)
912

@@ -21,14 +24,23 @@ All code examples can be found on the [Mailjet Documentation][doc].
2124

2225
## Getting Started
2326

24-
First, make sure you have an API key, and an API secret.
25-
Once you got them, save them in your environment:
27+
Grab your API and Secret Keys [here][api_credential]. You need them for authentication when using the Email API:
2628

2729
```bash
2830
export MJ_APIKEY_PUBLIC='your api key'
2931
export MJ_APIKEY_PRIVATE='your api secret'
3032
```
3133

34+
## API Versioning
35+
36+
The Mailjet API is spread among three distinct versions:
37+
38+
- `v3` - The Email API
39+
- `v3.1` - Email Send API v3.1, which is the latest version of our Send API
40+
- `v4` - SMS API
41+
42+
Since most Email API endpoints are located under `v3`, it is set as the default one and does not need to be specified when making your request. For the others you need to specify the version using `version`. For example, if using Send API `v3.1`:
43+
3244
``` python
3345
# import the mailjet wrapper
3446
from mailjet_rest import Client
@@ -38,11 +50,11 @@ import os
3850
API_KEY = os.environ['MJ_APIKEY_PUBLIC']
3951
API_SECRET = os.environ['MJ_APIKEY_PRIVATE']
4052

41-
mailjet = Client(auth=(API_KEY, API_SECRET), version='v3')
53+
mailjet = Client(auth=(API_KEY, API_SECRET), version='v3.1')
4254

4355
```
4456

45-
**NOTE**: `version` reflects the API version in the URL (`https://api.mailjet.com/{{ version }}/REST/`). It is `'v3'` by default and can be used to select another API version (for example `v3.1` for the new send API).
57+
For additional information refer to our [API Reference](https://dev.preprod.mailjet.com/reference/overview/versioning/).
4658

4759
## Make a `GET` request:
4860
``` python

0 commit comments

Comments
 (0)