Bearer logo

Quickly build your own Mailjet API Integration

  • Don’t waste time learning the Mailjet API behaviour
  • Use a pre-configured API client and OAuth1 implementation
  • Consume and transform the Mailjet API with functions
  • Host and scale your integration for free
  • Monitor and log every API call to the Mailjet API out of the box.
  • Integrate into your app within seconds using our integration clients
or read the documentation

As a developer, I want to build an integration on Mailjet

On Bearer

Clone the template

npm init bearer mailjet -t -d providers/mailjet
cd mailjet

Configure your API credentials

npm run bearer setup:auth
? Enter Mailjet Client ID:
? Enter Mailjet Client Secret:
Setup the integration with your Mailjet OAuth1 credentials. This will allow you to make authenticated API requests. Don't know your Mailjet OAuth1 credentials?

Test the pre-built function

npm run bearer invoke defaultFunction
{
  "data": {
    "Messages": [
      {
        "Status": "success",
        "CustomID": "",
        "To": [
          {
            "Email": "hello@bearer.sh",
            "MessageUUID": "b9e002c9-b06a-4b94-8d25-23329f021275",
            "MessageID": 288230376879431300,
            "MessageHref": "https://api.mailjet.com/v3/REST/message/288230376879431327"
          },
          {
            "Email": "corentin@bearer.sh",
            "MessageUUID": "e31ce67f-f232-4c3c-b65d-8553f4185517",
            "MessageID": 288230376879431300,
            "MessageHref": "https://api.mailjet.com/v3/REST/message/288230376879431328"
          }
        ],
        "Cc": [],
        "Bcc": []
      }
    ]
  }
}

Code your own function

npm run bearer generate:function myFunction
create: functions/myFunction.ts
Function generated
✨ Done
Use your function to call any Mailjet endpoint and map the data to your app models.

Deploy your integration

npm run bearer push
Refreshing tokens... done
✓ Generate bundle
✓ Transfer bundle
🐻 Integration successfully pushed.
Once your integration is ready, deploy it on the Bearer platform and you’re good to go!
On Your App

Add a Connect Component

JSReact
<script src="https://cdn.jsdelivr.net/npm/@bearer/js/lib/bearer.production.min.js"></script>
<script>
const bearerClient = bearer('BEARER_CLIENT_ID')
bearerClient.connect(
'INTEGRATION_UUID',
'YOUR_SETUP_ID',
{ authId: 'YOUR_USER_IDENTIFIER' }
)
</script>
Once users log in with their Mailjet account, your functions are able to query the API using their credentials.

Call your functions

JSReactNodeJSRuby
<script src="https://cdn.jsdelivr.net/npm/@bearer/js/lib/bearer.production.min.js"></script>
<script>
const bearerClient = bearer('BEARER_CLIENT_ID')
bearerClient.invoke('INTEGRATION_UUID', 'FUNCTION_NAME', {
query: { params: 'value' }
})
.then(() => {
console.log('Successfully invoked function')
})
.catch(() => {
console.log('Something went wrong')
})
</script>
Use our integration clients to call your functions from your app.

Featured Templates

Bearer - API integration Framework

Product

Company

Docs & Help

Legal

Bearer is on TwitterBearer is on GitHubBearer is on FacebookBearer is on LinkedInBearer is on Medium
© Copyright Bearer 2019