Get list of emails and statuses of Campaigns - node.js

I'm using the node-mailjet api, and I'm trying to use it to get a list of email statuses for each marketing campaign.
If you go on a sent marketing campaign in Mailjet itself, there's a place where you can download a csv, the list of all contacts the campaign was sent to, and the status of each email ( delivered/opened/clicked/bounce/spam/ etc.)
So, using the API, I'm currently able to get a list of all the marketing campaigns, but I don't see a way of getting the same data as the csv I described above.
I've been looking at the documentation here, no luck so far.

You would have to use the /message resource in this case with a combination of some filters like the CampaignID one were you would give the Campaign for which you would like to check all the messages within.
That would give you an digest stats for all the messages generated by the Campaign. Within the response you would be able to see the Contact as well as the Status of the message, exactly like the CSV that you would download from front-end. You could also filter upon Status as well using the /message resource.
Here is the Reference to the resource along with all the available filters.

Related

How to use Power Virtual Agents and Power Automate to let a Bot write in a user's outlook-calendar

I have created an bot for microsoft teams with power virtual agents. This bot works fine and people can talk with it in ms teams and give the bot some information about dates. For example you could tell the bot a start-date and an end-date for days you aren't able to work.
With the authentification in teams the bot also knows the username and the id of the person, who is talking with it.
Now I like to create an automated flow, which the bot should trigger with the infos like username, userid, startdate and enddate, which should do the following steps:
open/find the specific user's calendar in outlook/teams (I'm pretty sure both use the same calendar)
create for each day in the range of startdate and enddate a (full-day) entry, which says "unavailable"
for each conflict with another meeting in entries of Step 2. cancel the meeting (for the user with username)
post a summary in a specific ms teams channel
I got Step 4 already working fine.
Step 2, I think I've figured out aswell, but with regard to my following problem at Step 1:
There is the template flow: Get calendar, which returns (all?) available calendars. And there is another flow template for creating entries in a specific calendar(Step 2 with option full-day entry), which needs the calendar ID to work.
My big problem is, how am I supposed to get the calendar ID of a specific user?
Is there a way to get the specific calendarID for a username or a userid?
And then what can I do about Step 3?
Thank you a lot for your help.
greets Vulnin
Using Graph API you can get User Calendar ID GET https://graph.microsoft.com/v1.0/{id | userPrincipalName}/calendar
Parse JSON in use is when you take the raw JSON output data from Power Automate and transform it into values. The output of GET command in http returns raw JSON so, you have to parse JSON to use values.
For point 3 Only the organizer can cancel the meeting. Please refer to this document.
You can decline a meeting using Graph API request with POST https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/events/{id}/decline request.

Does the DocuSign Intermediate API plan let me use the API to get PDF and form fields?

I tried calling DocuSign sales and support (transferred around 3 times) and no one could give me a straight answer on this. Their "support" actually told be to try stackoverflow, so here I am...
I'm looking at their API pricing levels here: https://www.docusign.com/products-and-pricing/api-plans-b
If I have the Intermediate API, can I make the following API requests?
GET /restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}
GET /restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId}/form_data
The part that's throwing me for a loop is the DocuSign Connect feature in the Advanced API plan. The description of it is:
The DocuSign Connect module lets you configure webhooks for envelope events and recipient actions for some or all users in your account. It can also be used to transport the completed documents back to your app or website and to retrieve any form field data entered by your recipients.
I don't need the webhooks, but I need to be able to get the completed documents as PDFs and get the form field data. Do I really need the DocuSign Connect feature for that?
You will be fine with the intermediate plan. Here is the basic distinction between polling and Connect - With Connect, we will proactively notify YOU when key envelope events occur.
Otherwise, it's up to you to call GET /envelopes and/or GET /form_data to retrieve that information. Be wary of the resource limits when you poll.
As a quick aside, instead of making two requests to retrive that information, just make one - GET /envelopes?include=recipients,tabs. This will provide you all the information you seek in one request.
The important excerpt from that guide:
You may not exceed one GET request per unique envelope endpoint per 15
minutes. If you exceed this limit the request will not fail, but it
will be flagged as a violation of rate limits which can cause your app
to fail review to go-live review.
For example, the following transactions violate API rules due to the repeated GET requests to the first document and second recipient:
[12:00:00] POST /accounts/12345/envelopes
[12:01:00] GET /accounts/12345/envelopes/AAA/documents/1
[12:02:00] GET /accounts/12345/envelopes/AAA/recipients/2
[12:03:00] POST /accounts/12345/envelopes
[12:04:00] GET /accounts/12345/envelopes/AAA/documents/1 *
[12:05:00] GET /accounts/12345/envelopes/AAA/recipients/2 *
However, the following set of requests comply with API rules and limits and would not be flagged by the platform:
[12:00:00] POST /accounts/12345/envelopes
[12:01:00] GET /accounts/12345/envelopes/AAA
[12:16:00] GET /accounts/12345/envelopes/AAA
[12:17:00] GET /accounts/12345/envelopes/AAA/documents/1
[12:32:00] GET /accounts/12345/envelopes/AAA/documents/1
[12:40:00] PUT /accounts/12345/envelopes/AAA/recipients/1
[12:41:00] PUT /accounts/12345/envelopes/AAA/recipients/1

How do i fetch only internal messages from O365 using Graph API

I wan't to fetch only messages that are only internal to organization.
Right now the way i see is fetch domains first then for each message see if from/sender domain belongs to that message , based on that differentiate.
But this is lengthy process and not a foolproof technique.
Is there any GRAPH API query i can use which readily provides this ?
It does not apear that the REST API queries for Office 365 includes this information directly in the messages. From the Version 2.0 And the Beta this is not included in message output.
However, it looks like you might be able to get it from the REST API via the headers.
Try the following query:
https://graph.microsoft.com/beta/me/messages?$select=internetMessageHeaders&$top=1
This takes top one messages and shows you the email header of the message.
In the header look for X-OriginatorOrg. The value should be the main domain of your organisation.
Alternatively you can look at the X-MS-Exchange-Organization-MessageDirectionalityheader. If the value here is Originating it should come from inside your own organisation.

How to send email template multipe times to same list in Constant Contact?

I am running into an issue where I need to programmatically send the same email campaign to multiple people on a list that are the same via people(same email addresses) multiple times. Constant Contact is not letting me do this.
Example:
I want to use the same birthday campaign year after year and send it out once a year to everyone on my list. However according to the Constant Contact documentation I can only send the email campaign once too new email addresses.
Is there something in the API documentation that will let me do this?
So far all I have encountered is that I need to delete the email campaign, and recreate it using this API command: http://developer.constantcontact.com/docs/email-campaigns/email-campaigns-collection.html?method=POST
Thank you in advance.
Via the Constant Contact api's there is no way to send the same email campaign to the same contact multiple times.
However for the example that you have given there is an automation platform within Constant Contact that will automatically send out a birthday email, but at this time there is no way to programmatically set that up.
If you need to do it programmatically I would create a new campaign for each year, especially since deleting and recreating just creates a new campaign anyway.

Getting started with the Docusign API

I want to make sure I am on the right track as I have been having some problems getting started with the API. I am looking to maintain a list of product application PDFs as templates on docusign. When a customer comes to our site and wants a particular product they need to fill out an application form. All the data would be collected on our site. I would then want to:
Create an envolope with the customer (and potentially other parties) that need to sign the document
Fill in the form fields from data collected on our site
Send the envelope out for signature and monitor the progress.
So in doing this I am trying to build this up a piece at a time and first task is to make sure that I can provide form data to docusign. I create a template with the docusign web user interface and all of the form fields seem to be preserved. However when I try and retrieve the template with API
https://demo.docusign.net/restapi/v2/accounts/xxxx/templates/yyyy
I see a very short response with an envelopeTemplateDefinition showing the correct name for the template but no documents object and no custom fields object. I have also tried this by creating an envelope with the document (in draft) but with similar results.
My apologies in advance for this newbie question.
I've repro'd the issue you describe -- i.e., the Response I get from a GET Template request contains only very limited information and is thereby not consistent with the expected Response as documented on pages 194-196 of the DocuSign REST API guide (http://www.docusign.com/sites/default/files/REST_API_Guide_v2.pdf). Not sure if this is a bug with the GET Template operation or with the Documentation -- someone at DocuSign will need to confirm (#Ergin).
In light of this limitation with the GET Template operation, you can alternatively retrieve the recipient information (including tabs) and document information about a Template by using the GET Envelope Recipients and GET Envelope Documents operations -- just specify the TEMPLATE Id in place of the Envelope Id, as shown here:
GET https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes/{templateId}/documents
GET https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes/{templateId}/recipients?include_tabs=true

Resources