How to store birthday through mailchimp API? - mailchimp

I'm using mailchimp 1.3 in a Codeigniter application through this library.
I have this piece of code:
$birthday = date('m/d', strtotime('1984-04-29');
echo $birthday;
$merge_vars = array(
'FNAME'=> $profile_info['name'],
'LNAME'=> $profile_info['lastname'],
'birthday' => $birthday,
'GROUPINGS' => array(array('name' => $this->group_name, 'groups' => $this->group1))
);
$this->mail_chimp->listSubscribe($this->list_id, $email, $merge_vars);
The subscription works and in the administration panel of mailchimp I can see the user name and lastname, but no birthday.
In the api documentation it says it should be formatted as MM/DD and echoing the
birthday I verified it was right.
Any suggestions?

Ok, I solved.
I had to add a field for the birthday in the list settings as explained here:
http://kb.mailchimp.com/article/how-do-i-create-and-send-automatic-birthday-campaigns

Related

getOfferById method provided by an API does not work (invalid Id or Error cannot find parameter) [Laravel]

I am a junior developer working on this project.
I'm using an API who provide offers and I'm trying to display them.
They provide several methods as "getOffers" "search" "getOfferById".
I managed to display all the offers with the getOffers, but I can't use the getOfferById. I might be using it the wrong way.
They also provide us with a sandbox to play with the methods so when I put the id on the sandbox it works fine. Here is an exemple from the doc:
$offer = $soapClient->getOfferById($offerId, array('key' => 'length.unit', 'value' => 'm'));
and here is what I've tried so far :
$offerId = 2020012100009;
$offer = $soapClient->getOfferById($offerId, array('key' => 'length.unit', 'value' => 'm'));
dd($offer->length);
I get "Error can not find parameter" for this.
$offer = $soapClient->getOfferById($offerId);
and I get "Invalid Id" for this.
There is no such id in the database, are you sure that the id you providing is valid?
I resolved my problem. I had to apply it like that.
$offer = $soapClient->getOfferById(array(
'id' => $offerId
));

How to post image on facebook timeline using graph api 4.0?

I am creating an API to post on my Facebook timeline using graph API 4.0. For this, i am first creating an album and then post image in that album.
here is the code
$facebook = new Facebook(array(
'appId' => 'APP_ID',
'secret' => 'APP_SECRET',
'cookie' => true,
));
$user = $facebook->getUser();
if ($user) {
//Create an album
$album_details = array(
'message'=> 'Album desc',
'name'=> 'Album name'
);
$create_album = $facebook->apiRequest('/me/albums/{user-access-token}', 'post', $album_details);
dd($create_album);
}
which returns an error
Raw Provider API response: {\"error\":{\"message\":\" This object does not exist or does not support this action\"
But when i gave page token instead of a user access token , it works fine. I am new to this. So, i have no idea how to solve this.
The Facebook API no longer permits publishing to personal profile feeds.
https://developers.facebook.com/docs/graph-api/reference/v4.0/user/feed#publish
As of April 24,2018, the publish_actions permission has been removed. Please see the Breaking Changes Changelog for more details. To provide a way for your app users to share content to Facebook, we encourage you to use our Sharing products instead.

Google calendar api not showing the organizer name and sending notification emails - laravel

I'm using a laravel package for the google calendar API integration. In that, I am able to create events with just attendees only. I've tried creating organizer but it's not coming up. The following is the code I've used. The organizer name here defaults to the email from which the API credentials are created also the email notifications are not coming.
The package I'm using is spatie/laravel-google-calendar
Can anyone tell me what I'm doing wrong here?
Event::create([
'name' => 'Latest Event dsfdsfsdfsdf',
'location' => '800 Howard St., San Francisco, CA 94103',
'description' => 'A chance to hear more about Google\'s developer products.',
'startDateTime' => Carbon\Carbon::now(),
'endDateTime' => Carbon\Carbon::now()->addHour(),
'sendNotifications' => true,
'sendUpdates' => 'all',
'organizer' => array('email' => 'test#gmail.com','displayName' => 'Darshan')
'attendees' => array(
array('email' => 'test#gmail.com','displayName' => 'Darshan', 'organizer' => true),
array('email' => 'darshan#test.com','displayName' => 'Ryan')
)
]);
The package doesn't support adding an organizer yet. You could either add the functionality to the package or you could use the Google ApiClient directly. The Google Sdk does have a setOrganizer method which should work similar to the setAttendees method that is called in the Event class.
Apparently the word "organizer" is bit of a misnomer and it actually refers to the calendar that the event is created on. Have a look at this question and it's comments.

Google ADX Seller Rest API: get report by custom currency

I'm using Google ADX API to get revenues report by date range.
By default I'm getting the revenues in ILS but I what to get the currency in USD or EUR and I don't want to use currency conversions like https://www.google.com/finance/converter
According to the formal documentation api (https://developers.google.com/ad-exchange/seller-rest/reference/v1.1/reports/generate) I didn't find any way for this issue..
Thats what i'm doing in my php code:
$params = array(
'metric' => array('EARNINGS'),
'dimension' => array('DATE', 'AD_TAG_NAME', 'AD_TAG_CODE','CUSTOM_CHANNEL_NAME', 'CUSTOM_CHANNEL_ID'),
'sort' => '+DATE'
//'currency' => 'usd' - try to add custom currency but unsuccess
);
$service = new Google_Service_AdExchangeSeller($client);
$service->accounts_reports->generate($accountId, $dateFrom, $dateTo, $params);
print_r($report['header']); //print: [currency] => ILS
Does anyone know how to do it?
Thanks

Magento Rest API Issue When Using PayPal Payment Advanced

I'm using Magento's Rest API to sell item from my Wordpress based site. I am having an issue when I try to use PayPal Payment Advanced to complete the transaction. Here is the code below:
$paymentArray = array(
"method" => "payflow_advanced",
'cc_cid' => $_POST['cccvv'],
'cc_owner' => $_POST['firstName'] . " ". $_POST['lastName'],
'cc_number' => $_POST['ccnumber'],
//'cc_type' => "MC",
'cc_exp_year' => $_POST['ccmonth'],
'cc_exp_month' => $_POST['ccyear'],
);
$resultPaymentMethod = $client->call($session, 'cart_payment.method', array($shoppingCartIncrementId, $paymentArray));
When I run the code, it comes back as "true" but the api never hits PayPal and authorizes the transaction.
Once you var_dump($resultPaymentMethod) and see what's it displaying the output..

Resources