Jasper.ai

Introduction

Jasper.ai is an AI writing tool designed to generate marketing copy, such as blog posts, product descriptions, company bios, ad copy, and social media captions.

MoEngage <> Jasper.ai

With the MoEngage and Jasper.ai integration, you can use Jasper.ai's Generative AI to send out hyper-personalized and effective campaigns across channels on MoEngage.

Integration

library_add_check

Prerequisites

  • You would need your Jasper.ai API token to use their APIs.

Display dynamic content in MoEngage Campaigns

Using MoEngage's Content APIs, you can dynamically add content created by Jasper.ai inside MoEngage campaigns for a more personalized experience. Below is an example of generating a personalized subject line by using Gen AI, for an email campaign:

Step 1: Set up a MoEngage Content API

info

Information

We've revamped our dashboard settings UI. Content API is now available in Settings -> Advanced Settings -> Content API in the revamped UI. For more information, refer to Summary of Changes - Settings UI Revamp.

  1. Revamped UI Old UI

    Navigate to Settings -> Advanced Settings -> Content API. Click + Add content API at the top right corner of the Content API screen.

    ContentAPI_Navogation.png

  2. Add your Jasper.ai API to the endpoint URL. Depending on your use case, the endpoint will change. 

    To display a personalized AI-generated subject line, use Jasper.ai's Run Command API.

    While setting up your content API, select and method as POST and insert the following URL:

    https://api.jasper.ai/v1/command

    Leave the URL Parameters as blank.

    Under Headers, add the following:
    1. X-API-Key: For this, you need to generate a new Access Token from Jasper.ai's dashboard.
    2. content-type: application/json
    3. accept: application/json

      Under Body Type, select Raw, add the following:

    JSON
    {
      "inputs": {
        "command": "Write a personalized email subject line for a campaign about Christmas holidays",
        "context": "Email is being sent to {{UserAttribute['First Name']}} {{UserAttribute['Last Name']}}",
        "toneId": "<your_tone_id>"
      },
      "options": {
        "outputCount": 1,
        "outputLanguage": "English",
        "inputLanguage": "English",
        "languageFormality": "default",
        "completionType": "performance"
      }
    }
  3. Click on "Save" and then "Done" once you see a successful response.
  4. Note - You can also test your APIs. To test your APIs, from the Content API's action menu, click on "Test". You can your API response and validate it. 

Step 2: Display your content inside MoEngage campaigns

To use this API in your MoEngage campaigns,

  1. On step 2 on your campaign creation, enter @. 
  2. In the pop up, you can select Jasper.ai Content API configured in Step 1.
  3. You can use MoEngage Templating Language to parse through the API response and use the content in your campaigns.

    To display the subject line generated by Jasper, you can use the following code:
    JINJA
    {% set response = ContentApi.JasperAiParagraph({({"params":{},"static_params":{},"dynamic_params":{},"request_body":{"inputs":{"command":"Write a personalized email subject line for a campaign about Christmas holidays","context":"Email is being sent to {{UserAttribute['First Name']}} {{UserAttribute['Last Name']}}","toneId":"ton_2ee766eaa4ef48e59da1d9602bfecf2d"},"options":{"outputCount":1,"outputLanguage":"English","inputLanguage":"English","languageFormality":"default","completionType":"performance"}}})}) %}{{ response.data[0].text }}
  4. You can click on the Preview tab to view your campaign in real-time personalization:
  5. You can go ahead and Publish the campaign.

Previous

Next

Was this article helpful?
0 out of 0 found this helpful

How can we improve this article?