How to delete a Audience Manager Contact in code within Tridion 2011? - contacts

I'm using Tridion.OutboundEmail.ContentDelivery.Profile.Contact and I can't find any method of deleting a Contact.

There is no such option in the Content Delivery API.
You can only delete Contacts on the Content Manager side.
Use Tridion.AudienceManagement.API.Contact.Delete() to delete your Contacts.

What version of Tridion you are using?
In 2011 SP1, there is new API namespace for Contact. AFAIK, It is possible in 2011 on wards but not on 2009 (read-only API ?).
Namespace: Tridion.AudienceManagement.API. Below is the sample from API Docs
TcmUri uri = new TcmUri(3, 456, TcmItemTypes.Contact);
Contact contact = new Contact(uri);
contact.Delete();

Removing users may only be possible on the Content Manager API. Or at least the API docs for the Content Manager mention a Contact.Delete method, while that isn't mentioned in the API docs for the Content Delivery API.

Related

New Google Sites API

I know the current Google Sites API only supports Classic Sites.
Does this API exist now? and How to manage(create and etc) New Google Sites though API?
No, an API doesn't exist.
There are several feature requests in the issuetracker.google.com site, so they are aware it is needed. You would think they have some of the framework developed, since there is currently some access to sites (and I don't mean for editing) through the existing drive API. It would be worth adding your comments to those requests in the issue tracker website.
https://issuetracker.google.com/issues/36761330
https://issuetracker.google.com/issues/7324991
https://issuetracker.google.com/issues/120462223
https://issuetracker.google.com/issues/205856782
Though Google Sites API is still not available, I discovered some good news (for my use case, at least). I can confirm there are some minimal Google Sites abilities available through the Google Drive API. Specifically, I was able to add a user to the my site as viewer to a published site, using the Drive API permissions. Here is the Python code.
# get boilerplate creds= code from here https://developers.google.com/drive/api/quickstart/python
drive = build('drive', 'v3', credentials=creds)
new_permission = {
'type':'user',
'role':'reader',
'view':'published',
'emailAddress':USER_EMAIL
}
# you can get the SITE_FILEID from the site url
res = drive.permissions().create(fileId=SITE_FILEID, body=new_permission).execute()
Since the OP specifically asked about create, that works like so:
new_file = {
'name':'test site2',
'mimeType':'application/vnd.google-apps.site',
}
res = drive.files().create(body=new_file).execute()
Hope this can help some folks.
If you check Google sites api at the very top of the page it states.
If there was an api for accessing the new version they would have stated it. There is not.
According to this question, Google planned the new API for Google Sites for end of 2021: https://support.google.com/sites/thread/3363462/is-there-any-eta-for-the-new-google-sites-api?hl=en
I did not hear any news, since that.

Message Type on Facebook Messenger using Bot Framework

According to this documentation (https://developers.facebook.com/docs/messenger-platform/reference/send-api/) there will need to be a "messaging_type" property needed to be added to the payload for use on Facebook Messenger bots. Will this be automatically injected into the payload, or is this something we need to handle as a developer?
I stumbled upon this as I am researching how to add certain "tags" to the payload for pro-active messaging.
This issue Will Bot Framework support Facebook messaging_types? states the messaging_type is already set on every message and by default it's set to 'Response' and you can change this using ChannelData.
FranciscoPonceGomez on GitHub
We already support It. It defaults to ‘Response’ and can be changed via ‘messaging_type’ in channeldata.
I will send you a link with the updated documentation soon.
In C# you set the messaging_type like this:
activity.ChannelData = JObject.FromObject(new
{
messaging_type = "MESSAGE_TAG"
});
If you have successfully set the tag could you post your solution as it would really be of help to me and others :-)

Zend Gdata not working with google calendar API

My company is using zend gdata 1.11.7, relatively old, but they havent had the ability to move to newer things yet. We have a program that adds events to a google calendar based on the forms submitted by the user.
This morning, we now get the error below:
Fatal error: Uncaught exception 'Zend_Gdata_App_HttpException' with
message 'Expected response code 200, got 403< HTML>< HEAD><
TITLE>Forbidden< /HEAD>< BODY BGCOLOR="#FFFFFF"
TEXT="#000000">< H1>Forbidden< H2>Error 403< /BODY>< /HTML>
' in
/homepages/26/d119734641/htdocs/app/ZendGdata-1.11.7/ZendGdata-1.11.7/library/Zend/Gdata/App.php:709
From everything I am reading, this is an authentication issue...but I have a problem, it was built so long ago that we do not have access to the google console for the API, what else could be the problem? Did google stop supporting this way of authenticating that is used in this zend gdata?
Please help as currently I have everything happening manually from our online database to the calendar.
Found this post
Zend google Calendar access not working anymore
Seems they discontinued it....
Back in November 2011, we announced the deprecation of the Calendar GData API (v1, v2) when the APIv3 was made available. We’ll now be shutting down these older versions on November 17, 2014.
https://developers.google.com/api-client-library/php/
seems to be the way to go. Still working on replacing my Zend_GData (Zend V1 project) with this but it seems promissing.
EDIT
I can confirm i was able to migrate all my zend_Gdata to google-api-php-client-master.
I can create event, update event, delete event, i work also with extendedProperties, all is fine. I've just one concern about the OAuth and the refreshToken, i hope that i understood how it work.
/EDIT
You can't use Zend anymore to list, add, delete events. You have to use google api v3. Here is an example of class you can use to manage events: Authentification Zend Gdata (403 forbidden)

How to Get Sharepoint data?

I have just started a Sharepoint, I would need items listed in Sharepoint 2013.
Please let me know is any rest service available to access data from sharepoint which I can store in my local db.
Please suggest me what are the best way to access data from it.
Thanks,
Laxmilal Menaria
In SharePoint 2013 the REST API Endpoints are different.
It's more like this:
/_api/lists/getByTitle('Custom List')/Items
You can use the REST interface.
http://msdn.microsoft.com/en-in/library/ff798339.aspx
For example:
http://localhost/_vti_bin/listdata.svc/Parts(3)
The preceding URL returns the Parts list item with an ID value of 3 as an Atom feed.

Adding "web version link" in email by sendgrid

How do I add a link to a web version of my sendgrid emails like "having trouble reading this email, click here"?
[EDIT]
I use a php sendgrid library
include "sendgrid-php-master/SendGrid_loader.php";
And I use this code and it doesn't work :
$mail = new SendGrid\Mail();
....
$mail->setHtml('View this email in your browser<br />'.$sg_html_code);
...
Just to confirm what Lirianna said, here you have the answer from Sendgrid support team to the same question:
Using [Weblink] will only be supported when using our Marketing Campaigns tool. To use this in a transactional template, you would need to create and host that link yourself.
Please be aware that SendGrid terminated the [weblink] and [unsubsribe] in 2017 (30/09/2017). You need to migrate with the new migrating toolkit.
Read more from SendGrid here
It's the latter half of 2021 and I tried using {{Weblink}} (capitalisation important) and it works just fine for me using the Dynamic Templates option.. YMMV
As per the official SendGrid documentation {{Weblink}} is available.
Refer: SendGrid docmentation link