Filtering by email addresses and names in SurveyMonkey's API v3 - surveymonkey

I'm upgrading my application from SurveyMonkey's API v2 to v3 and using the liogi/surveymonkey-api-v3 library to wrap around my API calls and have run into a problem.
The email, first_name, and last_name parameters for such endpoints as GET /surveys/{id}/responses/bulk seem to be ignored. No matter what value I enter for them, no responses get filtered out of my results.
Is this a bug?

Yes adding those as GET parameters in your request should filter responses by that recipient information.
For example:
/v3/surveys/<survey_id>/responses/bulk?email=test#example.com
Will return responses for survey <survey_id> where the recipient had email test#example.com. Note that only collectors of type email invitation have contact information that you can filter by. So responses taken by weblink will never have that data.
I just tested it out on the bulk endpoint and it successfully filtered it to just the one response with the email I used. I would first try to track the request your library is making to make sure it is sending the proper request format, if the request is proper and it still isn't filtering I would contact SurveyMonkey with more details about your request as in that case it'd likely be a bug.

Related

MSGraph - Getting external email conversation from reply

My team is building a ticketing system. The goal is when we receive a new email we create a new ticket. All responses to that email are saved on the same ticket.
We have these basic goals working in simple cases, however, there is one case that we are struggling to find a good solution for. A client will email us, which creates a ticket, and we reply back requiring information. The client will send our reply to someone internal to their company. Then they will send the response back to us by replying with "see below". This response will have the conversation between them and their co-worker in the comment section of the email. The comment section will also contain our entire email chain which we don't want to duplicate.
The issue we are having is grabbing the conversation they had from the comment section to include with their response of "see below" and add them to the ticket. The only method we have come up with to solve this is manually parsing the comment section of the email, however, this is error-prone.
Does anyone know of a better way of tracking conversations they send you through the email?
We are using msgraph internally to send and receive emails and using their apis they have uniqueBody and body, but they don't seem to have a way to break the body up into its different parts.
What I need any of these options
1- get list of unique bodies from the email chain without using conversation Id as it will not be sufficient in some cases.
2- get the previous conversation Id of the incoming email. I mean if that email is a list of emails and it forwards to me.
UUID uuid = UUID.randomUUID();
message.addProperty("InternetMessageId", String.format("%s",uuid.toString()));
send InternetMessageId with a unique identifier to grab conversation id
change order only

Microsoft Graph API get message returns empty string

I am querying to get a single message from the Microsoft graph API like the following:
https://graph.microsoft.com/v1.0/users/<name>/messages/<id>
However, i am getting a response that is just an empty string. If i make the same request using the beta version of the api like the following:
https://graph.microsoft.com/beta/users/<name>/messages/<id>
The email in question is a calendar share invitation of content-type of "application/ms-tnef" and content-class of "Sharing" in the email headers.
I can't find any documentation indicating this is a known issue in the system. Is there any way to get this to work in the graph API or is the only work-around is to use the beta version instead?
Using Graph Explorer, and recreating your request using their demo accounts returns a result in v1.0. I assumed by name you meant the user's email address and I made the same request using the Guid id of the user.
https://graph.microsoft.com/v1.0/users/MeganB#M365x214355.onmicrosoft.com/messages/AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAHi4GJzAAA=
https://graph.microsoft.com/v1.0/users/48d31887-5fad-4d73-a9f5-3c356e68a038/messages/AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAIgOnGGAAA=
Have you attempted the same request using graph explorer?

Microsoft Graph API SDK .NET Issues getting other users emails

I am using the Microsoft Graph SDK as downloaded from NuGet (1.2). I authenticate to Azure AD (using ADAL).
I am using Client Credentials flow (not authenticated as any particular user) and am using Application Permission roles to access resources.
We are going to set up one service mailbox with a bunch of aliases. The aliases are given to the clients. This is so they are emailing an address that has a meaningful name to them.
My app will run as a service, and routinely scan new emails in this inbox. It should find the To address, and depending on what alias was used, file the email in a location relevant to that client.
The resource I want is: GET /users/<id | userPrincipalName>/messages
However, there doesn't appear to be a method in the SDK for it.
I can get users with this:
IGraphServiceUsersCollectionPage filteredUsers =
graphApi.Users.Request()
.Filter("userPrincipalName eq 'user#domain.com'")
.GetAsync().Result;
When I loop through the collection, I can see that the User has a 'Messages' property, but it is always null.
If I manually build a request message with HttpClient I can get the messages.
The second problem is that the Recipient property is always the userPrincipalName of the mailbox. How can I get the alias that was used by the sender?
While you are able to get your collection of users successfully, you have to make another request to receive the messages. This would look something like:
IUserMessagesCollectionPage userMessages =
graphApi.Users["user_id"].Messages.Request()
.GetAsync().Result;
To answer your second question, at this time you cannot access the original recipient through the Graph API, but you can do this through EWS. This is due to the fact that you can only retrieve the SMTP message headers through EWS. You can read more about how to do this here.
If this is something you believe is valuable to you in the Graph, I would encourage you to post it in our UserVoice.
If you want to get the email as a file, you can simply get the body as bytes through the SDK:
byte[] asBytes = Encoding.Unicode.GetBytes(message.Body.ToString());

Public/Private Events When Querying Facebook Graph API

I'm building an RoR application that uses the Facebook Graph API, scraping a users events via their user_access token. I'm essentially taking that user token and making a Graph call to the API, getting all the events the user has either given a rsvp, created, declined, maybe and not_replied response to the events they've been invited to. Here is my query...
GraphAPIEndPoint = [created, declined, maybe, not_replied]
GraphAPIEndPoint.each do|endpoint|
data = Koala::Facebook::API.new(access_token)
events = data.get_connections("me", "events/#{endpoint}", fields: ['id',"name","description","place","start_time","end_time","timezone","ticket_uri", "cover"])
end
This query gives me the desired data but I'm unsure whether I'm getting private events from the user, which I don't want. After I've received the data, I've checked some source url's in my browser, which show a Facebook default error page saying, "Sorry this page isn't available". Other Facebook url's I've tested show me their events as public events, only the ones that seem specific to a group of friends or family give me this default error page. Also, if the events were deleted by the author (which could be an answer as to why I'm getting the default error page), why am I still getting the JSON for the event?
My only assumption is that I am, and if so, what are the privacy parameters to prevent this from happening and give me only the public events?(Please no FQL suggestions)
Thanks for your help!

Mandrill Status: queued

I'm testing the Mandrill API and sent an email to my GMail account. In the API logs, it says:
"status": "queued"
According to https://mandrill.zendesk.com/hc/en-us/articles/205582717-Why-does-a-delivered-message-say-queued- :
most times Mandrill can send email much faster than recipient servers
are able to accept or process it
GMail is not able to handle my one email that I sent?
A queued response in the Mandrill API is not the same as a queued response from a recipient server.
When you send a message through Mandrill, you first relay it to Mandrill, Mandrill processes it, and then Mandrill relays it to the recipient server. This all happens quite quickly, but the two relaying steps are separate and distinct. The KB article you've linked to is providing additional details on that last step, relaying to recipient servers, not a queued status for the Mandrill API.
There are a number of reasons the Mandrill API may respond with queued including if you've added attachments or if you're sending to a bunch of recipients in a single API call.
Without seeing the actual API call that's being made, it's hard to say why you're getting a queued response. But if you're using the sample messages/send API call, you'll want to remove all of the optional parameters that you're not actually setting. For example, the sample has fake attachments, and a subaccount specified. The attachment will cause the call to be processed async. The subaccount probably doesn't exist, and would then cause the call to fail. So if that's the case, try removing all of those optional params. If not, please provide the API call you're making with sensitive data redacted (API key, actual email addresses).
The reason might be either hourly/monthly quota is over or you are using same multiple accounts for single public ip server.

Resources