Hello,
Anybody has experience with calling API from Mandrill (see https://www.mandrill.com/) ?
I will need to send email through this API and I don't know how to start.
Thx,
Serge
Calling Mailchimp - Mandrill API
Moderator: Rathinagiri
- serge_girard
- Posts: 3166
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Calling Mailchimp - Mandrill API
There's nothing you can do that can't be done...
Re: Calling Mailchimp - Mandrill API
Hi Serge.
I think, you can use cUrl to connect with Mandrill API.
I don't have a valid API key to check it out, but maybe try this, on the example https://mandrillapp.com/api/docs/users. ... thod=ping2
I get a response from the server that I did not provide the valid API key.
If you just want to send an emails, maybe just use SMTP: https://mandrill.zendesk.com/hc/en-us/a ... -Languages
It looks like a simple mechanism for sending email messages.
I think, you can use cUrl to connect with Mandrill API.
I don't have a valid API key to check it out, but maybe try this, on the example https://mandrillapp.com/api/docs/users. ... thod=ping2
Code: Select all
#include "hmg.ch"
#include "hbcurl.ch"
#include "common.ch"
Function Main()
DEFINE WINDOW Mandrill_Curl AT 0 , 0 WIDTH 0 HEIGHT 0 TITLE "" MAIN;
ON INIT (Mandrill_Curl(), ThisWindow.Release);
NOSHOW;
NOMINIMIZE;
NOMAXIMIZE;
NOSIZE;
NOSYSMENU;
NOCAPTION
END WINDOW
ACTIVATE WINDOW Mandrill_Curl
QUIT
Return Nil
****************************************************************************************
Function Mandrill_Curl()
Local cURL:="https://mandrillapp.com/api/1.0/users/ping2.json"
Local cAPIKey:='example key'
Local cPOSTdata:='{"key":"' + cAPIKey + '"}'
//Init
Local curlHandle := curl_easy_init()
IF EMPTY(curlHandle)
MsgStop("Error while init cURL lib.")
RETURN
ENDIF
curl_easy_reset( curlHandle )
curl_easy_setopt(curlHandle, HB_CURLOPT_URL, cURL)
curl_easy_setopt(curlHandle, HB_CURLOPT_SSL_VERIFYPEER, 0 )
//curl_easy_setopt(curlHandle, HB_CURLOPT_PORT, nPort)
curl_easy_setopt(curlHandle, HB_CURLOPT_USERAGENT, "Mandrill-Curl/1.0" )
curl_easy_setopt(curlHandle, HB_CURLOPT_POSTFIELDSIZE, LEN( cPOSTdata ) )
curl_easy_setopt(curlHandle, HB_CURLOPT_POSTFIELDS, cPOSTdata )
curl_easy_setopt(curlHandle, HB_CURLOPT_DOWNLOAD )
curl_easy_setopt(curlHandle, HB_CURLOPT_DL_BUFF_SETUP )
/* Do everything */
curlErr := curl_easy_perform(curlHandle)
/* Report any errors */
IF !EMPTY( curlErr )
MsgStop(curl_easy_strerror(curlErr))
ELSE
//Response from the server
MsgInfo(curl_easy_dl_buff_get( curlHandle ))
ENDIF
//Close
curl_global_cleanup( curlHandle )
RETURN
*****************************************************************************************
If you just want to send an emails, maybe just use SMTP: https://mandrill.zendesk.com/hc/en-us/a ... -Languages
It looks like a simple mechanism for sending email messages.
- serge_girard
- Posts: 3166
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: Calling Mailchimp - Mandrill API
Thanks a lot !
I will receive my key this afternoon. The meaning is to send daily some 100-200 emails. Do you advice API or SMTP solution?
Serge
I will receive my key this afternoon. The meaning is to send daily some 100-200 emails. Do you advice API or SMTP solution?
Serge
There's nothing you can do that can't be done...
Re: Calling Mailchimp - Mandrill API
It depends on what you want to achieve, e.g. whether you want to receive statistics or just send email messages. I think that just SMTP is enough to send messages.
- serge_girard
- Posts: 3166
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: Calling Mailchimp - Mandrill API
Hi Krzysztof,
See private messages !
Greetings, Serge
See private messages !
Greetings, Serge
There's nothing you can do that can't be done...
Re: Calling Mailchimp - Mandrill API
Serge, I'm attaching binary of curl.
I also receive the same message from my tests:
'https://mandrillapp.com/api/1.0/users/ping.json' can not be in apostrophes, as shown in the example.
It looks as if the example from https://mandrillapp.com/api/docs/users. ... ethod=ping did not work, try to contact the support.
I also receive the same message from my tests:
Instead of "example key" use your key.c: \ curl-7.53.1-win32-mingw \ bin> curl -A 'Mandrill-Curl / 1.0' -d '{"key": "example key"}' https://mandrillapp.com/api/1.0 /users/ping2.json
{"status": "error", "code": - 1, "name": "ValidationError", "message": "You must specify
a key value "}
c: \ curl-7.53.1-win32-mingw \ bin>
'https://mandrillapp.com/api/1.0/users/ping.json' can not be in apostrophes, as shown in the example.
It looks as if the example from https://mandrillapp.com/api/docs/users. ... ethod=ping did not work, try to contact the support.
- Attachments
-
- curl-7.53.1-win32-mingw.7z
- (1.67 MiB) Downloaded 194 times
- serge_girard
- Posts: 3166
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: Calling Mailchimp - Mandrill API
OK, thanks!
I keep you informed!
Serge
I keep you informed!
Serge
There's nothing you can do that can't be done...
- serge_girard
- Posts: 3166
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: Calling Mailchimp - Mandrill API
Hello Krzysztof,
It seems my MailChimp account is not OK for Mandrill use.... I wait till next week!
Thanks !
Serge
It seems my MailChimp account is not OK for Mandrill use.... I wait till next week!
Thanks !
Serge
There's nothing you can do that can't be done...