Check if an email address is already in a list using MailChimp API v3.0 without subscribing the email address - rest

Is it possible to check whether the email is already in a list or not via the new MailChimp API v3.0?
I know I can make a post request to the lists/{list_id}/members/ endpoint that returns a 400 Bad Request error if the email is in the list.
This is ok and it helps, but it does subscribe the email as well if it is not in there already.
My main goal is not to subscribe just to check.

The ID of the user is the MD5 hash of their email address. So make a call to /3.0/lists/<list_id>/members/<email_md5> -- if that returns a 404, the user isn't on your list. If you get a 200, the resulting object has a status field that will tell you whether the user is subscribed or not.

Related

SendGrid send mail - how to keep track of emails?

I am sending emails from sendgrid from my backend. When I send the email, the response is 202 and the response body is empty. Since the response body is empty, i do not have any information like an ID to track the email events in my system.
When I go to fetch the events, i see they have an ID, but since I don't have that ID from their creation, I cant map emails I sent to events I received.
Can you give an email an ID or label it somehow when you send it? So that you can map al the events from it?
What we are trying to do is to have a list of "transactions" where each "Transaction" is affiliated with an email. We want to provide email event data in our app, but can't figure out how to map
The response body of a successful Mail Send API call is empty, but the response contains a x-message-id header which you can use to retrieve details about the messages being sent.
Since one API call to the Mail Send API can result in multiple emails being sent, this ID identifies the group of messages, and they'll all be prefixed with the x-message-id. For example, if x-message-id returns W86EgYT6SQKk0lRflfLRsA, the IDs of your messages will start with that and then be suffixed with something like .filterdrecv-5645d9c87f-78xgx-1-62841247-82.1.
Together it'd look like W86EgYT6SQKk0lRflfLRsA.filterdrecv-5645d9c87f-78xgx-1-62841247-82.1.
If you want to track the messages, you can use the event webhook or pull the information via the Email Activity Feed API.
This Stack Overflow Q&A about tracking bulk email statuses may also be useful to look at.

Recognize the email account the URI is clicked from

I'm emailing to user with URI(s) in the message body. When the user will click that URI link, the app will answer the calls depending on the params on the URI.
However, all these should happen depending on which eMail account this URI is clicked from.
Eg. the system sent the email to thisUser#xyz.com. Then, the owner of thisUser#xyz.com forwarded the message to, say thatUser#xyz.com.
The system should be able to be aware that the URI sent to thisUser#xyz.comis being clicked by thatUser#xyz.com. Is there a way to make such distinction? How?
I can make the user verify his credentials-- enter his username&passwd but this is not what i'm looking for.
No, this is not possible, as the only information sent to the server is the URI, which is always the same.
Email clients do not send additional information about the recipient of an email to a server when the user clicks on a link in the email. Doing so would be a bad idea, because of privacy concerns, as it could be exploited for, e.g., farming email addresses using chain emails.

RESTful way to request an action?

If part of my RESTful api like looks like this:
POST transactions?auth_code=[code]
and part of this post is an email address so the server can send a receipt and at a later time the client wants to have the receipt sent again, how would I create the API for that? The server returns a transactionID from the POST. Should I do something like this:
PUT transactions/[transactionID]?auth_code=[code]&requestReceipt=YES
Thanks.
I would invert the POST/PUT calls. PUT to create something new (in this case a transaction with an email address) and POST to resend the receipt. If POST in that endpoint (/transactions/[transactionID]) is only used to resend the confirmation, I would omit the requestReceipt parameter.

New #facebook.com email - API Howto?

With the new #facebook.com emails being available for all users I'm wondering if there is an Graph API call that can be made to obtain a users facebook email address?
From what I've seen you can simple take the users alias (as we see in the URL) and slap on the #facbook.com to get the email. Until I cam across a friend who had his FB Id instead of the alias listed on his account.
I tested this by sending an email to myself using myid#facebook.com and myalias#facebook.com. The ID failed to send while the alias sent and was received with no issues.
Ideas?
Thanks.
Some people can receive mails from both ID#facebook.com and ALIAS#facebook.com, and some people cannot receive ID#facebook.com with an mailer error saying that it's not in their address book.
I wasn't able to see any pattern here, it was random. Not sure this is an error or a spec.

XMPP Framework: Not able to receive my messages

I am working on xmpp framework. I have done most of initial things. I created stream, Connected it and get authenticate. Now I am sending buddy request to another user from my app. App shows presence is sent. When I get roster it shows a entry there. But on other system I am not getting any precence or anything. I tried to send a message message is also not received by other client.
Than I used one id in ichat and send friend request to that id. Wow I am able to see friend request on ichat. I accept request from ichat :( No notification on my app.
If I send message to ichat. Message shown in iChat. but when I send message to my app from ichat.. My app is not getting any delegate called or nothing.
I don't know why this is happening.
I am using a non ARC xmpp framework.
Please guys Please help me. I am badly stucked in it :(
Thanks in Advance.
Have you consider to send presence after get authenticate?
If you are authenticate but not sending preence than server will consider you offline and all messages sent to you will be stored on server with delay.
Send your presence and see the magic. :)
I am not an iPhone developer so i can not explain programming.
In XMPP, Presence subscription has two handshakes. Like When first user send request to second user , it will ask for presence subscription to second user. When second user accept , then first user is subscribed for second user's presence. So he can get all the presence of second user. It's called "to" subscription type for first user. Now second user ask for presence subscription to first user and first accepts request then this "to" subscription type changed to "both" subscription type. Now both user can get presence of each other. otherwise only first user can get presence of second user.
And for messages, there must be a some prob with listener.