Getting a contact by email using the sendgrid api - sql

I'm trying to retrieve contact id by email using the sendgrid 'Contacts API'. It looks like the way to do this is to POST to the /marketing/contacts/search endpoint.
I'm not familiar with SQL, does anybody know how I'd query the email field as explained here:
https://sendgrid.api-docs.io/v3.0/contacts/search-contacts

on the link that you provide there is a tab that is called "try it out" click there and you can try it out. Just add your Api token and there is already a query that you just need to add the email address
{
"query": "email LIKE 'ENTER_COMPLETE_OR_PARTIAL_EMAIL_ADDRESS_HERE'"
}
if you are adding a partial email address just add % before or/and after (depending which side is missing info)

Related

How to get displayName (Name, Surname) from external organization smtp address in Outlook API?

all, and thanks for your support.
I have a list of e-mails (ex: johndoe#company1.com, maryjane#company2.com) and need their DisplayTo names.
By "DisplayTo" I mean the name that appears after the first e-mail is sent ("ABC" in red).
So it should be something like "John Doe" or "Jane, Mary", which is how future e-mails to them appear (only the first one appears as name#company.com).
The Address Catalog only has internal company e-mails. I could not find a way to get this information in Outlook API documentation, is there a way to do this?
Thanks a million!
Pass the SMTP address to Namespace.CreateRecipient (returns Recipient object). Call Recipient.Resolve, then use Recipient.AddressEntry.GetExchangeUser.FirstName/LastName/etc (error / null checking omitted).

How to add a contact to a list in ActiveCampaign API v3

According to v3 docs I should be able to add a contact to a list using the Contact API but I am at a loss on how to do so as I see nothing list related under Contacts.
How do I add a contact to a list (not through automations) using version 3 of the API? Or are the docs in error?
The v3 docs have been updated (Lists documentation) and they no longer read that you can add a contact to a list through the API. ActiveCampaign Lists documentation screenshot
EDIT: you can add a contact to a list using the v1 contact_sync (contact_sync documentation)
SECOND EDIT: you can now add a contact to a list and/or change their subscription status to a given list through the v3 API!
(update list status for a contact documentation)
The above is no longer true. You can add a contact using the Create Contact endpoint.
It's basically a POST request that uses the following parameters:
E-Mail (Required)
First Name (Optional)
Last Name (Optional)
Phone (Optional)
The API v3 changed a lot though and now after you create a contact to do the following this you have to consult other endpoints. For example:
To add a contact to a list you need a POST request to the Contact Lists endpoint where you need to provide three parameters (listid, contactid, status).
If you need to assign a tag to a contact, in order to be able to create the relationship you first need to create the tag using the Create a new tag endpoint. And the use the resulting tag id with the Create Contact Tag endpoint where you combine said tag id with the contact id.
Now in order to remove that same tag the guys from Active Campaign made us work more and in order to remove a tag from a contact you don't use the contact's id and the tag's id, but rather you have to use the contact's id and the relationship id between the tag and the specific contact, that's quite a lot of steps, but I guess they wanted to make it very robuts in terms of structure.
There are many new endpoints which were actually available from around the date when you asked your question. You should check out the new API reference. It has some flaws and is not 100% complete yet, but it would be useful.
Hope this helps since it gave me some head heck... Using activecampaign php sdk when adding a contact with the sync command you can also add it to a list:
$list_id = 'thelistid';
$contact = array(
"email" => 'contactemail#doamin.com',
"p[{$list_id}]" => $list_id,
"status[{$list_id}]" => 1, // "Active" status
);
$contact_sync = $ac->api("contact/sync", $contact);
They wrote it also as examples on the repository but for some reason I didn't catch it.

Slack API - Don't notify user when parsing user id

In this message formatting doc: https://api.slack.com/docs/message-formatting, you can use special control sequence characters < and > to perform server-side parsing (server-side as in Slack API's server-side).
So using <#U024BE7LH> in your chat.postMessage() call will get parsed to something like #bob or whatever the username associated with that ID is, in the actual text that shows up in slack.
Unfortunately, this will cause a notification for the person you're referring to. How do I make it so that it doesn't notify the person? I've tried to enclose in a code block, i.e.:
`<#U024BE7LH>`
or
```
<#U024BE7LH>
```
But it still pings. I'm thinking the only way is to get a list of users and parse the name from the ID.
According to this, backticks should work but empirically it hasn't for me. The Slack employee says to just convert the user ID to their name and use that without the templating.
https://forums.slackcommunity.com/s/question/0D73a000005n0OXCAY/detail?language=en_US&fromEmail=1&s1oid=00Dj0000001q028&s1nid=0DB3a000000fxl3&s1uid=0053a00000Ry9cX&s1ext=0&emkind=chatterCommentNotification&emtm=1667894666436&emvtk=fH.W2M01lq9W1cf31RSROPwB7LYs.och8RgbVTqoNlg%3D&t=1667931570045

Using query string parameter in Kentico marketing automation process

I am trying to set up a marketing automation process that is kicked off when a user visits a particular web page on my site. The URL to that web page is going to be included in an email blast to a set of Kentico contacts.
I was hoping to be able to add a query string parameter to the end of the URL so that I can capture the e-mail address of the contact and store it in the Contact Email field,
i.e. http://example.com/mypage?email=xx#xxx.com.
My first attempt at this was setting up a marketing automation workflow that is triggered when the user visits the page, then using a 'Set Contact Property' step to set the contact's email address to the query string value, but I can't seem to be able to get the value of the query string parameter. I've tried {? email?}, {% QueryString.email%}, etc. with no luck.
Anyone have any ideas?
You are very close. Try this:
{% QueryString["nameOfQueryString"] %}
So if my URL were http://www.exmaple.com/mypage?email=testEmail#example.com, and I wanted to resolve the query string called "email" I would write:
{% QueryString["email"] %}
And it would resolve "testEmail#example.com".
Side Note: I would not recommend using your users' emails as the query string. I would use a GUID to build the URL and associate the user's email with a GUID in a SQL table.
So, if the email address "testEmail#exaple.com" was associated to the guid 25892e17-80f6-415f-9c65-7395632f0223, you would build a URL like this:
http://www.exmaple.com/mypage?id=25892e17-80f6-415f-9c65-7395632f0223
Then when the user visits this page, you can tell who they are by comparing the GUID to their email.

Create direct url to LinkedIn company update

I'm implementing a Compony newsfeed on a website and ran into the following problem. The LinkedIn API doesn't provide a direct URL to a company update. Looking at the LinkedIn site there are direct URL's and they're like this for example:
https://www.linkedin.com/company/1441/comments?topic=5849556347070205952&type=U&scope=1441&stype=C&a=5uHW&goback=%2Ebzo_*1_*1_*1_*1_*1_*1_*1_1441
Trying stuff out it seems that the parameters topic, type, scope, stype and a are mandatory for the URL to work.. (goback is the only one that isn't).
Using the LinkedIn API with the Company updates call I'm able to buid the direct url, except for the a parameter. The value is always 4 (for me unexplainable) characters long.
Has anyone ever successfully build a direct URL to a company update or can someone maybe explain the a parameter or how to generate its value?
Updated to new format
You can link directly to any update (company or user) using the following url:
https://www.linkedin.com/feed/update/urn:li:activity:[topic_id]
You can get [topic_id] by getting the last bit of the updateKey in the api response from Linkedin. When updateKey = UPDATE-c7352-6410848097894756353, your topic_id = 6410848097894756353.
In your example that would become https://www.linkedin.com/feed/update/urn:li:activity:5849556347070205952 which links directly to the specific update. The post is too old to work with the new link format
The url used to be
https://www.linkedin.com/nhome/updates/?topic=[topic_id]
Updated thanks to the comment from #sethpollack
For anyone trying to get the topic id from the API response object (as already commented on the OP question), the topic id is the value after the last hyphen of the updateKey property, which can be used with #Daan answer:
"updateKey": "UPDATE-cXXXX-YYYYYYYYYYYYYYYYYY"
Direct URL:
https://www.linkedin.com/nhome/updates?topic=[YYYYYYYYYYYYYYYYYY]
Using the URL format above, get the topic_id by opening the update in its own window/tab, look at the page source code in your browser and search for the string :activity: the long number after the string is the infamous topic_id