MailChimp

classic Classic list List threaded Threaded
24 messages Options
12
Reply | Threaded
Open this post in threaded view
|

MailChimp

Pavel | 4000ft
Is there any documentation or samples how to subscribe single email address to a MailChimp list, for lasso 9?

Thanks, Pavel


#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MailChimp

stevepiercy
Not specifically for 9, but there is the mailchimp tag, which
might work as is with 9.
http://www.lassosoft.com/tagswap/detail/mailchimp

I recommend using JSON for the API.  Also I had to tweak the tag
to use the latest API, use HTTPS, and get other nifty features.

     local(
         'apikey' = string,
         'output' = 'json',
         'url' = 'https://us1.api.mailchimp.com',
         'version' = 1.3
     );

Details
http://lasso.2283332.n4.nabble.com/Mailchimp-Batch-Subscribe-tp4635764p4635767.html

--steve


On 2/22/13 at 7:19 PM, [hidden email] pronounced:

>Is there any documentation or samples how to subscribe single
>email address to a MailChimp list, for lasso 9?
>
>Thanks, Pavel
>
>
>#############################################################
>This message is sent to you because you are subscribed to
>the mailing list Lasso
>[hidden email]
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy               Web Site Builder              
Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MailChimp

Pavel | 4000ft
In reply to this post by Pavel | 4000ft
Steve,
The lasso 8 tag from Jason Huck did not work as is, however after a few modifications of the URL, (addressing some changes and updates from MC API pages) I'm able to get "Everything's Chimpy!" response after issuing the $mychimp->ping.

Interestingly I'm getting the same error as Stephen (Black Night Software in one of your conversation on this earlier)
{"error":"You must specify a id value for the listBatchSubscribe method","code":-90})
I'm sure, I have the correct ID.
I'm able to use
$mychimp->lists
and display the ID (and also Web_ID, which I tried as well).

Anybody out there who implemented MC successfully with lasso 9 ?

Thanks, Pavel


#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MailChimp

Pavel | 4000ft
In reply to this post by Pavel | 4000ft
Steve,
The lasso 8 tag from Jason Huck did not work as is, however after a few modifications of the URL, (addressing some changes and updates from MC API pages) I'm able to get "Everything's Chimpy!" response after issuing the $mychimp->ping.

Interestingly I'm getting the same error as Stephen (Black Night Software in one of your conversation on this earlier)
{"error":"You must specify a id value for the listBatchSubscribe method","code":-90})
I'm sure, I have the correct ID.
I'm able to use
$mychimp->lists
and display the ID (and also Web_ID, which I tried as well).

Anybody out there who implemented MC successfully with lasso 9 ?

Thanks, Pavel


#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MailChimp

stevepiercy
In reply to this post by Pavel | 4000ft
The error from MC indicates you are not passing in an id value
for the method you used, where the id = the list id in MC.
http://apidocs.mailchimp.com/api/1.3/listbatchsubscribe.func.php
This error has nothing to do with the version of Lasso used.

I suggest using this method instead for a SINGLE email address:
http://apidocs.mailchimp.com/api/1.3/listsubscribe.func.php

Decide whether you want to use the default double opt-in
setting.  I typically use double_optin = false, but with discretion.

--steve


On 2/23/13 at 12:41 AM, [hidden email] pronounced:

>Steve,
>The lasso 8 tag from Jason Huck did not work as is, however
>after a few modifications of the URL, (addressing some changes
>and updates from MC API pages) I'm able to get "Everything's
>Chimpy!" response after issuing the $mychimp->ping.
>
>Interestingly I'm getting the same error as Stephen (Black
>Night Software in one of your conversation on this earlier)
>{"error":"You must specify a id value for the
>listBatchSubscribe method","code":-90})
>I'm sure, I have the correct ID. I'm able to use
>$mychimp->lists and display the ID (and also Web_ID, which I
>tried as well).
>
>Anybody out there who implemented MC successfully with lasso 9 ?
>
>Thanks, Pavel
>
>
>#############################################################
>This message is sent to you because you are subscribed to
>the mailing list Lasso
>[hidden email]
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy               Web Site Builder              
Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MailChimp

Anibal Escobar
In reply to this post by Pavel | 4000ft
Hi, I'm trying to get the mailchimp tag to work as well.  I've modified Jason Huck's tag to include the correct url and version:

        local(
                'apikey' = string,
                'output' = 'json',
                'url' = 'https://us3.api.mailchimp.com',
                'version' = 2.0
        );

However, when I run

        var('mychimp') = mailchimp( -key='mykey-us3', -output='json');
        $mychimp->ping;

I get the following error:

faultCode -32601 faultString Unknown method "/"

It looks like for version 2.0, the method names have changed, so for example, it looks like ping is now helper/ping.  However, doing

$mychimp->helper/ping; throws an error
and
$mychimp->('helper/ping'); returns
\_global__current__unknowntag

Any thoughts on how to do this?

Thanks,
Anibal Escobar
[hidden email]




On Feb 23, 2013, at 12:41 AM, [hidden email] wrote:

> Steve,
> The lasso 8 tag from Jason Huck did not work as is, however after a few modifications of the URL, (addressing some changes and updates from MC API pages) I'm able to get "Everything's Chimpy!" response after issuing the $mychimp->ping.
>
> Interestingly I'm getting the same error as Stephen (Black Night Software in one of your conversation on this earlier)
> {"error":"You must specify a id value for the listBatchSubscribe method","code":-90})
> I'm sure, I have the correct ID.
> I'm able to use
> $mychimp->lists
> and display the ID (and also Web_ID, which I tried as well).
>
> Anybody out there who implemented MC successfully with lasso 9 ?
>
> Thanks, Pavel
>
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MailChimp

stevepiercy
Lasso methods cannot have "/" in their names.  Suggest using "_" instead.

Then replace "_" with "/" and append it to the URL to get your API method.

I'm probably leaving out a few details, but hopefully that gets you started.

--steve


On 11/5/13 at 10:41 AM, [hidden email] (Anibal Escobar) pronounced:

> Hi, I'm trying to get the mailchimp tag to work as well.  I've modified Jason
> Huck's tag to include the correct url and version:
>
>   local(
>       'apikey' = string,
>       'output' = 'json',
>       'url' = 'https://us3.api.mailchimp.com',
>       'version' = 2.0    
>   );
>
> However, when I run
>
>   var('mychimp') = mailchimp( -key='mykey-us3', -output='json');
>   $mychimp->ping;
>
> I get the following error:
>
> faultCode -32601 faultString Unknown method "/"
>
> It looks like for version 2.0, the method names have changed, so for example, it
> looks like ping is now helper/ping.  However, doing
>
> $mychimp->helper/ping; throws an error
> and
> $mychimp->('helper/ping'); returns
> \_global__current__unknowntag
>
> Any thoughts on how to do this?
>
> Thanks,
> Anibal Escobar
> [hidden email]
>
>
>
>
> On Feb 23, 2013, at 12:41 AM, [hidden email] wrote:
>
> > Steve,
> > The lasso 8 tag from Jason Huck did not work as is, however after a few
> modifications of the URL, (addressing some changes and updates from MC API pages)
> I'm able to get "Everything's Chimpy!" response after issuing the $mychimp->ping.
> >
> > Interestingly I'm getting the same error as Stephen (Black Night Software in one
> of your conversation on this earlier)
> > {"error":"You must specify a id value for the listBatchSubscribe
> method","code":-90})
> > I'm sure, I have the correct ID.
> > I'm able to use
> > $mychimp->lists
> > and display the ID (and also Web_ID, which I tried as well).
> >
> > Anybody out there who implemented MC successfully with lasso 9 ?
> >
> > Thanks, Pavel
> >
> >
> > #############################################################
> > This message is sent to you because you are subscribed to
> >  the mailing list Lasso
> > [hidden email]
> > To unsubscribe, E-mail to: <[hidden email]>
> > Send administrative queries to  <[hidden email]>
>
>
> #############################################################
> This message is sent to you because you are subscribed to
>   the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy               Web Site Builder               Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>


#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MailChimp

Anibal Escobar
Thanks so much for your suggestion!  There's one more change from version 1.3 to 2.0 to deal with, namely that the method and output are not sent as url get parameters, but as part of the url.  I modified the custom tag with:

                local('tmethod'=#method);
                #tmethod->replace('_','/');
                local('uri') = self->'url' + '/' + self->'version' + '/'+#tmethod+'.'+self->'output';

to replace:

                local('uri') = self->'url' + '/' + self->'version' + '/';
                #uri += '?output=' + self->'output' + '&method=' + #method;

and it now works.

Thanks,
Anibal Escobar
[hidden email]




On Nov 5, 2013, at 11:03 AM, Steve Piercy - Web Site Builder <[hidden email]> wrote:

> Lasso methods cannot have "/" in their names.  Suggest using "_" instead.
>
> Then replace "_" with "/" and append it to the URL to get your API method.
>
> I'm probably leaving out a few details, but hopefully that gets you started.
>
> --steve
>
>
> On 11/5/13 at 10:41 AM, [hidden email] (Anibal Escobar) pronounced:
>
>> Hi, I'm trying to get the mailchimp tag to work as well.  I've modified Jason
>> Huck's tag to include the correct url and version:
>>
>>  local(
>>      'apikey' = string,
>>      'output' = 'json',
>>      'url' = 'https://us3.api.mailchimp.com',
>>      'version' = 2.0    
>>  );
>>
>> However, when I run
>>
>>  var('mychimp') = mailchimp( -key='mykey-us3', -output='json');
>>  $mychimp->ping;
>>
>> I get the following error:
>>
>> faultCode -32601 faultString Unknown method "/"
>>
>> It looks like for version 2.0, the method names have changed, so for example, it
>> looks like ping is now helper/ping.  However, doing
>>
>> $mychimp->helper/ping; throws an error
>> and
>> $mychimp->('helper/ping'); returns
>> \_global__current__unknowntag
>>
>> Any thoughts on how to do this?
>>
>> Thanks,
>> Anibal Escobar
>> [hidden email]
>>
>>
>>
>>
>> On Feb 23, 2013, at 12:41 AM, [hidden email] wrote:
>>
>>> Steve,
>>> The lasso 8 tag from Jason Huck did not work as is, however after a few
>> modifications of the URL, (addressing some changes and updates from MC API pages)
>> I'm able to get "Everything's Chimpy!" response after issuing the $mychimp->ping.
>>>
>>> Interestingly I'm getting the same error as Stephen (Black Night Software in one
>> of your conversation on this earlier)
>>> {"error":"You must specify a id value for the listBatchSubscribe
>> method","code":-90})
>>> I'm sure, I have the correct ID.
>>> I'm able to use
>>> $mychimp->lists
>>> and display the ID (and also Web_ID, which I tried as well).
>>>
>>> Anybody out there who implemented MC successfully with lasso 9 ?
>>>
>>> Thanks, Pavel
>>>
>>>
>>> #############################################################
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso
>>> [hidden email]
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>>  the mailing list Lasso
>> [hidden email]
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy               Web Site Builder               Soquel, CA
> <[hidden email]>                  <http://www.StevePiercy.com/>
>
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MailChimp

Anibal Escobar
Now i'm stuck reading the response from mailchimp.  The following code:

        decode_json($mychimp->helper_ping);

results in an empty page

$mychimp->helper_ping by itself returns:

{"msg":"Everything's Chimpy!"} and is type bytes.

Thanks,
Anibal Escobar
[hidden email]




On Nov 5, 2013, at 11:28 AM, Anibal Escobar <[hidden email]> wrote:

> Thanks so much for your suggestion!  There's one more change from version 1.3 to 2.0 to deal with, namely that the method and output are not sent as url get parameters, but as part of the url.  I modified the custom tag with:
>
> local('tmethod'=#method);
> #tmethod->replace('_','/');
> local('uri') = self->'url' + '/' + self->'version' + '/'+#tmethod+'.'+self->'output';
>
> to replace:
>
> local('uri') = self->'url' + '/' + self->'version' + '/';
> #uri += '?output=' + self->'output' + '&method=' + #method;
>
> and it now works.
>
> Thanks,
> Anibal Escobar
> [hidden email]
>
>
>
>
> On Nov 5, 2013, at 11:03 AM, Steve Piercy - Web Site Builder <[hidden email]> wrote:
>
>> Lasso methods cannot have "/" in their names.  Suggest using "_" instead.
>>
>> Then replace "_" with "/" and append it to the URL to get your API method.
>>
>> I'm probably leaving out a few details, but hopefully that gets you started.
>>
>> --steve
>>
>>
>> On 11/5/13 at 10:41 AM, [hidden email] (Anibal Escobar) pronounced:
>>
>>> Hi, I'm trying to get the mailchimp tag to work as well.  I've modified Jason
>>> Huck's tag to include the correct url and version:
>>>
>>> local(
>>>     'apikey' = string,
>>>     'output' = 'json',
>>>     'url' = 'https://us3.api.mailchimp.com',
>>>     'version' = 2.0    
>>> );
>>>
>>> However, when I run
>>>
>>> var('mychimp') = mailchimp( -key='mykey-us3', -output='json');
>>> $mychimp->ping;
>>>
>>> I get the following error:
>>>
>>> faultCode -32601 faultString Unknown method "/"
>>>
>>> It looks like for version 2.0, the method names have changed, so for example, it
>>> looks like ping is now helper/ping.  However, doing
>>>
>>> $mychimp->helper/ping; throws an error
>>> and
>>> $mychimp->('helper/ping'); returns
>>> \_global__current__unknowntag
>>>
>>> Any thoughts on how to do this?
>>>
>>> Thanks,
>>> Anibal Escobar
>>> [hidden email]
>>>
>>>
>>>
>>>
>>> On Feb 23, 2013, at 12:41 AM, [hidden email] wrote:
>>>
>>>> Steve,
>>>> The lasso 8 tag from Jason Huck did not work as is, however after a few
>>> modifications of the URL, (addressing some changes and updates from MC API pages)
>>> I'm able to get "Everything's Chimpy!" response after issuing the $mychimp->ping.
>>>>
>>>> Interestingly I'm getting the same error as Stephen (Black Night Software in one
>>> of your conversation on this earlier)
>>>> {"error":"You must specify a id value for the listBatchSubscribe
>>> method","code":-90})
>>>> I'm sure, I have the correct ID.
>>>> I'm able to use
>>>> $mychimp->lists
>>>> and display the ID (and also Web_ID, which I tried as well).
>>>>
>>>> Anybody out there who implemented MC successfully with lasso 9 ?
>>>>
>>>> Thanks, Pavel
>>>>
>>>>
>>>> #############################################################
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list Lasso
>>>> [hidden email]
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>
>>>
>>> #############################################################
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso
>>> [hidden email]
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>> Steve Piercy               Web Site Builder               Soquel, CA
>> <[hidden email]>                  <http://www.StevePiercy.com/>
>>
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso
>> [hidden email]
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MailChimp

stevepiercy
That's odd.  Try:

decode_json(string($mychimp->helper_ping));

Also view source of the empty page.  If the result is HTML or XML, you won't see it.

FWIW:

    local('j' = bytes('{"msg":"Everythings Chimpy!"}'));
    decode_json(#j);

=> map: (msg)=(Everythings Chimpy!)

--steve


On 11/5/13 at 11:55 AM, [hidden email] (Anibal Escobar) pronounced:

> Now i'm stuck reading the response from mailchimp.  The following code:
>
>   decode_json($mychimp->helper_ping);
>
> results in an empty page
>
> $mychimp->helper_ping by itself returns:
>
> {"msg":"Everything's Chimpy!"} and is type bytes.
>
> Thanks,
> Anibal Escobar
> [hidden email]
>
>
>
>
> On Nov 5, 2013, at 11:28 AM, Anibal Escobar <[hidden email]> wrote:
>
> > Thanks so much for your suggestion!  There's one more change from version 1.3 to
> 2.0 to deal with, namely that the method and output are not sent as url get
> parameters, but as part of the url.  I modified the custom tag with:
> >
> >         local('tmethod'=#method);
> >         #tmethod->replace('_','/');
> >         local('uri') = self->'url' + '/' + self->'version' +
> '/'+#tmethod+'.'+self->'output';
> >
> > to replace:
> >
> >         local('uri') = self->'url' + '/' + self->'version' + '/';
> >         #uri += '?output=' + self->'output' + '&method=' + #method;
> >
> > and it now works.
> >
> > Thanks,
> > Anibal Escobar
> > [hidden email]
> >
> >
> >
> >
> > On Nov 5, 2013, at 11:03 AM, Steve Piercy - Web Site Builder
> <[hidden email]> wrote:
> >
> >> Lasso methods cannot have "/" in their names.  Suggest using "_" instead.
> >>
> >> Then replace "_" with "/" and append it to the URL to get your API method.
> >>
> >> I'm probably leaving out a few details, but hopefully that gets you started.
> >>
> >> --steve
> >>
> >>
> >> On 11/5/13 at 10:41 AM, [hidden email] (Anibal Escobar) pronounced:
> >>
> >>> Hi, I'm trying to get the mailchimp tag to work as well.  I've modified Jason
> >>> Huck's tag to include the correct url and version:
> >>>
> >>> local(
> >>>     'apikey' = string,
> >>>     'output' = 'json',
> >>>     'url' = 'https://us3.api.mailchimp.com',
> >>>     'version' = 2.0    
> >>> );
> >>>
> >>> However, when I run
> >>>
> >>> var('mychimp') = mailchimp( -key='mykey-us3', -output='json');
> >>> $mychimp->ping;
> >>>
> >>> I get the following error:
> >>>
> >>> faultCode -32601 faultString Unknown method "/"
> >>>
> >>> It looks like for version 2.0, the method names have changed, so for example,
> it
> >>> looks like ping is now helper/ping.  However, doing
> >>>
> >>> $mychimp->helper/ping; throws an error
> >>> and
> >>> $mychimp->('helper/ping'); returns
> >>> \_global__current__unknowntag
> >>>
> >>> Any thoughts on how to do this?
> >>>
> >>> Thanks,
> >>> Anibal Escobar
> >>> [hidden email]
> >>>
> >>>
> >>>
> >>>
> >>> On Feb 23, 2013, at 12:41 AM, [hidden email] wrote:
> >>>
> >>>> Steve,
> >>>> The lasso 8 tag from Jason Huck did not work as is, however after a few
> >>> modifications of the URL, (addressing some changes and updates from MC API
> pages)
> >>> I'm able to get "Everything's Chimpy!" response after issuing the
> $mychimp->ping.
> >>>>
> >>>> Interestingly I'm getting the same error as Stephen (Black Night Software in
> one
> >>> of your conversation on this earlier)
> >>>> {"error":"You must specify a id value for the listBatchSubscribe
> >>> method","code":-90})
> >>>> I'm sure, I have the correct ID.
> >>>> I'm able to use
> >>>> $mychimp->lists
> >>>> and display the ID (and also Web_ID, which I tried as well).
> >>>>
> >>>> Anybody out there who implemented MC successfully with lasso 9 ?
> >>>>
> >>>> Thanks, Pavel
> >>>>
> >>>>
> >>>> #############################################################
> >>>> This message is sent to you because you are subscribed to
> >>>> the mailing list Lasso
> >>>> [hidden email]
> >>>> To unsubscribe, E-mail to: <[hidden email]>
> >>>> Send administrative queries to  <[hidden email]>
> >>>
> >>>
> >>> #############################################################
> >>> This message is sent to you because you are subscribed to
> >>> the mailing list Lasso
> >>> [hidden email]
> >>> To unsubscribe, E-mail to: <[hidden email]>
> >>> Send administrative queries to  <[hidden email]>
> >>
> >> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> >> Steve Piercy               Web Site Builder               Soquel, CA
> >> <[hidden email]>                  <http://www.StevePiercy.com/>
> >>
> >>
> >> #############################################################
> >> This message is sent to you because you are subscribed to
> >> the mailing list Lasso
> >> [hidden email]
> >> To unsubscribe, E-mail to: <[hidden email]>
> >> Send administrative queries to  <[hidden email]>
> >
> >
> > #############################################################
> > This message is sent to you because you are subscribed to
> >  the mailing list Lasso
> > [hidden email]
> > To unsubscribe, E-mail to: <[hidden email]>
> > Send administrative queries to  <[hidden email]>
>
>
> #############################################################
> This message is sent to you because you are subscribed to
>   the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy               Web Site Builder               Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>


#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MailChimp

Anibal Escobar
Thanks again for your pointer!  It turns out that the mailchimp response has a leading line feed character.  This is why Jason's code didn't do the following:

                if(#response && (#response->beginswith('[') || #response->beginswith('{')) && self->'output' == 'json');
                        #response = decode_json(#response);

once I remove the leading line feed, decode_json works as expected.

Thanks,
Anibal Escobar
[hidden email]




On Nov 5, 2013, at 12:20 PM, Steve Piercy - Web Site Builder <[hidden email]> wrote:

> That's odd.  Try:
>
> decode_json(string($mychimp->helper_ping));
>
> Also view source of the empty page.  If the result is HTML or XML, you won't see it.
>
> FWIW:
>
>    local('j' = bytes('{"msg":"Everythings Chimpy!"}'));
>    decode_json(#j);
>
> => map: (msg)=(Everythings Chimpy!)
>
> --steve
>
>
> On 11/5/13 at 11:55 AM, [hidden email] (Anibal Escobar) pronounced:
>
>> Now i'm stuck reading the response from mailchimp.  The following code:
>>
>>  decode_json($mychimp->helper_ping);
>>
>> results in an empty page
>>
>> $mychimp->helper_ping by itself returns:
>>
>> {"msg":"Everything's Chimpy!"} and is type bytes.
>>
>> Thanks,
>> Anibal Escobar
>> [hidden email]
>>
>>
>>
>>
>> On Nov 5, 2013, at 11:28 AM, Anibal Escobar <[hidden email]> wrote:
>>
>>> Thanks so much for your suggestion!  There's one more change from version 1.3 to
>> 2.0 to deal with, namely that the method and output are not sent as url get
>> parameters, but as part of the url.  I modified the custom tag with:
>>>
>>>        local('tmethod'=#method);
>>>        #tmethod->replace('_','/');
>>>        local('uri') = self->'url' + '/' + self->'version' +
>> '/'+#tmethod+'.'+self->'output';
>>>
>>> to replace:
>>>
>>>        local('uri') = self->'url' + '/' + self->'version' + '/';
>>>        #uri += '?output=' + self->'output' + '&method=' + #method;
>>>
>>> and it now works.
>>>
>>> Thanks,
>>> Anibal Escobar
>>> [hidden email]
>>>
>>>
>>>
>>>
>>> On Nov 5, 2013, at 11:03 AM, Steve Piercy - Web Site Builder
>> <[hidden email]> wrote:
>>>
>>>> Lasso methods cannot have "/" in their names.  Suggest using "_" instead.
>>>>
>>>> Then replace "_" with "/" and append it to the URL to get your API method.
>>>>
>>>> I'm probably leaving out a few details, but hopefully that gets you started.
>>>>
>>>> --steve
>>>>
>>>>
>>>> On 11/5/13 at 10:41 AM, [hidden email] (Anibal Escobar) pronounced:
>>>>
>>>>> Hi, I'm trying to get the mailchimp tag to work as well.  I've modified Jason
>>>>> Huck's tag to include the correct url and version:
>>>>>
>>>>> local(
>>>>>    'apikey' = string,
>>>>>    'output' = 'json',
>>>>>    'url' = 'https://us3.api.mailchimp.com',
>>>>>    'version' = 2.0    
>>>>> );
>>>>>
>>>>> However, when I run
>>>>>
>>>>> var('mychimp') = mailchimp( -key='mykey-us3', -output='json');
>>>>> $mychimp->ping;
>>>>>
>>>>> I get the following error:
>>>>>
>>>>> faultCode -32601 faultString Unknown method "/"
>>>>>
>>>>> It looks like for version 2.0, the method names have changed, so for example,
>> it
>>>>> looks like ping is now helper/ping.  However, doing
>>>>>
>>>>> $mychimp->helper/ping; throws an error
>>>>> and
>>>>> $mychimp->('helper/ping'); returns
>>>>> \_global__current__unknowntag
>>>>>
>>>>> Any thoughts on how to do this?
>>>>>
>>>>> Thanks,
>>>>> Anibal Escobar
>>>>> [hidden email]
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Feb 23, 2013, at 12:41 AM, [hidden email] wrote:
>>>>>
>>>>>> Steve,
>>>>>> The lasso 8 tag from Jason Huck did not work as is, however after a few
>>>>> modifications of the URL, (addressing some changes and updates from MC API
>> pages)
>>>>> I'm able to get "Everything's Chimpy!" response after issuing the
>> $mychimp->ping.
>>>>>>
>>>>>> Interestingly I'm getting the same error as Stephen (Black Night Software in
>> one
>>>>> of your conversation on this earlier)
>>>>>> {"error":"You must specify a id value for the listBatchSubscribe
>>>>> method","code":-90})
>>>>>> I'm sure, I have the correct ID.
>>>>>> I'm able to use
>>>>>> $mychimp->lists
>>>>>> and display the ID (and also Web_ID, which I tried as well).
>>>>>>
>>>>>> Anybody out there who implemented MC successfully with lasso 9 ?
>>>>>>
>>>>>> Thanks, Pavel
>>>>>>
>>>>>>
>>>>>> #############################################################
>>>>>> This message is sent to you because you are subscribed to
>>>>>> the mailing list Lasso
>>>>>> [hidden email]
>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>> Send administrative queries to  <[hidden email]>
>>>>>
>>>>>
>>>>> #############################################################
>>>>> This message is sent to you because you are subscribed to
>>>>> the mailing list Lasso
>>>>> [hidden email]
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>> Steve Piercy               Web Site Builder               Soquel, CA
>>>> <[hidden email]>                  <http://www.StevePiercy.com/>
>>>>
>>>>
>>>> #############################################################
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list Lasso
>>>> [hidden email]
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>
>>>
>>> #############################################################
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso
>>> [hidden email]
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>>  the mailing list Lasso
>> [hidden email]
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy               Web Site Builder               Soquel, CA
> <[hidden email]>                  <http://www.StevePiercy.com/>
>
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MailChimp

Anibal Escobar
In reply to this post by stevepiercy
Can methods have dashes in their names?  I'm getting an error with:

$mychimp->lists_merge-vars(-apikey='mykey', -id='myid');

which is supposed to call the method lists/merge-vars

Thanks,
Anibal Escobar
[hidden email]




On Nov 5, 2013, at 11:03 AM, Steve Piercy - Web Site Builder <[hidden email]> wrote:

> Lasso methods cannot have "/" in their names.  Suggest using "_" instead.
>
> Then replace "_" with "/" and append it to the URL to get your API method.
>
> I'm probably leaving out a few details, but hopefully that gets you started.
>
> --steve
>
>
> On 11/5/13 at 10:41 AM, [hidden email] (Anibal Escobar) pronounced:
>
>> Hi, I'm trying to get the mailchimp tag to work as well.  I've modified Jason
>> Huck's tag to include the correct url and version:
>>
>>  local(
>>      'apikey' = string,
>>      'output' = 'json',
>>      'url' = 'https://us3.api.mailchimp.com',
>>      'version' = 2.0    
>>  );
>>
>> However, when I run
>>
>>  var('mychimp') = mailchimp( -key='mykey-us3', -output='json');
>>  $mychimp->ping;
>>
>> I get the following error:
>>
>> faultCode -32601 faultString Unknown method "/"
>>
>> It looks like for version 2.0, the method names have changed, so for example, it
>> looks like ping is now helper/ping.  However, doing
>>
>> $mychimp->helper/ping; throws an error
>> and
>> $mychimp->('helper/ping'); returns
>> \_global__current__unknowntag
>>
>> Any thoughts on how to do this?
>>
>> Thanks,
>> Anibal Escobar
>> [hidden email]
>>
>>
>>
>>
>> On Feb 23, 2013, at 12:41 AM, [hidden email] wrote:
>>
>>> Steve,
>>> The lasso 8 tag from Jason Huck did not work as is, however after a few
>> modifications of the URL, (addressing some changes and updates from MC API pages)
>> I'm able to get "Everything's Chimpy!" response after issuing the $mychimp->ping.
>>>
>>> Interestingly I'm getting the same error as Stephen (Black Night Software in one
>> of your conversation on this earlier)
>>> {"error":"You must specify a id value for the listBatchSubscribe
>> method","code":-90})
>>> I'm sure, I have the correct ID.
>>> I'm able to use
>>> $mychimp->lists
>>> and display the ID (and also Web_ID, which I tried as well).
>>>
>>> Anybody out there who implemented MC successfully with lasso 9 ?
>>>
>>> Thanks, Pavel
>>>
>>>
>>> #############################################################
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso
>>> [hidden email]
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>>  the mailing list Lasso
>> [hidden email]
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy               Web Site Builder               Soquel, CA
> <[hidden email]>                  <http://www.StevePiercy.com/>
>
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MailChimp

Anibal Escobar
Here's another question.  I'm using include_url to debug these connections, so I have:

include_url('https://us3.api.mailchimp.com/2.0/lists/merge-vars.json', -postparams=array('apikey'='mykey-us3', 'id'=array('id')));

according to the mailchimp api, the id parameter must be an array.  The code above produces

Validation error: {\"id\":\"Please enter an array\"}"}

so I'm guessing I'm using the wrong format to send an array as a param with postparams.  Any suggestions?

Thanks,
Anibal Escobar
[hidden email]




On Nov 5, 2013, at 3:28 PM, Anibal Escobar <[hidden email]> wrote:

> Can methods have dashes in their names?  I'm getting an error with:
>
> $mychimp->lists_merge-vars(-apikey='mykey', -id='myid');
>
> which is supposed to call the method lists/merge-vars
>
> Thanks,
> Anibal Escobar
> [hidden email]
>
>
>
>
> On Nov 5, 2013, at 11:03 AM, Steve Piercy - Web Site Builder <[hidden email]> wrote:
>
>> Lasso methods cannot have "/" in their names.  Suggest using "_" instead.
>>
>> Then replace "_" with "/" and append it to the URL to get your API method.
>>
>> I'm probably leaving out a few details, but hopefully that gets you started.
>>
>> --steve
>>
>>
>> On 11/5/13 at 10:41 AM, [hidden email] (Anibal Escobar) pronounced:
>>
>>> Hi, I'm trying to get the mailchimp tag to work as well.  I've modified Jason
>>> Huck's tag to include the correct url and version:
>>>
>>> local(
>>>     'apikey' = string,
>>>     'output' = 'json',
>>>     'url' = 'https://us3.api.mailchimp.com',
>>>     'version' = 2.0    
>>> );
>>>
>>> However, when I run
>>>
>>> var('mychimp') = mailchimp( -key='mykey-us3', -output='json');
>>> $mychimp->ping;
>>>
>>> I get the following error:
>>>
>>> faultCode -32601 faultString Unknown method "/"
>>>
>>> It looks like for version 2.0, the method names have changed, so for example, it
>>> looks like ping is now helper/ping.  However, doing
>>>
>>> $mychimp->helper/ping; throws an error
>>> and
>>> $mychimp->('helper/ping'); returns
>>> \_global__current__unknowntag
>>>
>>> Any thoughts on how to do this?
>>>
>>> Thanks,
>>> Anibal Escobar
>>> [hidden email]
>>>
>>>
>>>
>>>
>>> On Feb 23, 2013, at 12:41 AM, [hidden email] wrote:
>>>
>>>> Steve,
>>>> The lasso 8 tag from Jason Huck did not work as is, however after a few
>>> modifications of the URL, (addressing some changes and updates from MC API pages)
>>> I'm able to get "Everything's Chimpy!" response after issuing the $mychimp->ping.
>>>>
>>>> Interestingly I'm getting the same error as Stephen (Black Night Software in one
>>> of your conversation on this earlier)
>>>> {"error":"You must specify a id value for the listBatchSubscribe
>>> method","code":-90})
>>>> I'm sure, I have the correct ID.
>>>> I'm able to use
>>>> $mychimp->lists
>>>> and display the ID (and also Web_ID, which I tried as well).
>>>>
>>>> Anybody out there who implemented MC successfully with lasso 9 ?
>>>>
>>>> Thanks, Pavel
>>>>
>>>>
>>>> #############################################################
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list Lasso
>>>> [hidden email]
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>
>>>
>>> #############################################################
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso
>>> [hidden email]
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>> Steve Piercy               Web Site Builder               Soquel, CA
>> <[hidden email]>                  <http://www.StevePiercy.com/>
>>
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso
>> [hidden email]
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MailChimp

Brad Lindsay
On 11/5/13, 4:07 PM, Anibal Escobar wrote:
> Here's another question.  I'm using include_url to debug these connections, so I have:
>
> include_url('https://us3.api.mailchimp.com/2.0/lists/merge-vars.json', -postparams=array('apikey'='mykey-us3', 'id'=array('id')));
>
> according to the mailchimp api, the id parameter must be an array.  The code above produces
>
> Validation error: {\"id\":\"Please enter an array\"}"}
>
> so I'm guessing I'm using the wrong format to send an array as a param with postparams.  Any suggestions?

Probably needs to be a JSON array:

include_url(
        'https://us3.api.mailchimp.com/2.0/lists/merge-vars.json',
        -postparams=array('apikey'='mykey-us3', 'id'=encode_json(array('id')))
);

(I'm assuming this is 8.6, hence the encode_json)


Brad

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MailChimp

Anibal Escobar
I'm on 8.5.6.  I tried sending 'id'=encode_json(array('id')) and same error.  I'm wondering whether I should try using XML instead of JSON.  Any thoughts?

Thanks,
Anibal Escobar
[hidden email]




On Nov 5, 2013, at 4:21 PM, Brad Lindsay <[hidden email]> wrote:

> On 11/5/13, 4:07 PM, Anibal Escobar wrote:
>> Here's another question.  I'm using include_url to debug these connections, so I have:
>>
>> include_url('https://us3.api.mailchimp.com/2.0/lists/merge-vars.json', -postparams=array('apikey'='mykey-us3', 'id'=array('id')));
>>
>> according to the mailchimp api, the id parameter must be an array.  The code above produces
>>
>> Validation error: {\"id\":\"Please enter an array\"}"}
>>
>> so I'm guessing I'm using the wrong format to send an array as a param with postparams.  Any suggestions?
>
> Probably needs to be a JSON array:
>
> include_url(
> 'https://us3.api.mailchimp.com/2.0/lists/merge-vars.json',
> -postparams=array('apikey'='mykey-us3', 'id'=encode_json(array('id')))
> );
>
> (I'm assuming this is 8.6, hence the encode_json)
>
>
> Brad
>
> #############################################################
> This message is sent to you because you are subscribed to
> the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MailChimp

stevepiercy
In reply to this post by Anibal Escobar
Nope.  I think this diagram is valid for 8, too:
http://lassoguide.com/language/methods.html#syntax-for-signatures

...where "name" must start with a single [a-zA-Z_], followed by
any number of [a-zA-Z0-9_] (regex character class).

--steve


On 11/5/13 at 3:28 PM, [hidden email] (Anibal Escobar) pronounced:

>Can methods have dashes in their names?  I'm getting an error with:
>
>$mychimp->lists_merge-vars(-apikey='mykey', -id='myid');
>
>which is supposed to call the method lists/merge-vars
>
>Thanks,
>Anibal Escobar
>[hidden email]
>
>
>
>
>On Nov 5, 2013, at 11:03 AM, Steve Piercy - Web Site Builder
><[hidden email]> wrote:
>
>>Lasso methods cannot have "/" in their names.  Suggest using "_" instead.
>>
>>Then replace "_" with "/" and append it to the URL to get your API method.
>>
>>I'm probably leaving out a few details, but hopefully that gets you started.
>>
>>--steve
>>
>>
>>On 11/5/13 at 10:41 AM, [hidden email] (Anibal Escobar) pronounced:
>>
>>>  Hi, I'm trying to get the mailchimp tag to work as well.  
>>>I've modified Jason  Huck's tag to include the correct url
>>>and version:
>>>    local(
>>>      'apikey' = string,
>>>      'output' = 'json',
>>>      'url' = 'https://us3.api.mailchimp.com',
>>>       'version' = 2.0       );
>>>   However, when I run
>>>    var('mychimp') = mailchimp( -key='mykey-us3', -output='json');
>>>  $mychimp->ping;
>>>   I get the following error:
>>>   faultCode -32601 faultString Unknown method "/"
>>>   It looks like for version 2.0, the method names have
>>>changed, so for example, it  looks like ping is now
>>>helper/ping.  However, doing
>>>   $mychimp->helper/ping; throws an error
>>> and
>>> $mychimp->('helper/ping'); returns
>>> \_global__current__unknowntag
>>>   Any thoughts on how to do this?
>>>   Thanks,
>>> Anibal Escobar
>>> [hidden email]
>>>      On Feb 23, 2013, at 12:41 AM, [hidden email] wrote:
>>>
>>>> Steve,
>>>> The lasso 8 tag from Jason Huck did not work as is, however after a few
>>> modifications of the URL, (addressing some changes and updates from MC API
>pages)
>>> I'm able to get "Everything's Chimpy!" response after issuing the
>$mychimp->ping.
>>>>   Interestingly I'm getting the same error as Stephen
>>>>(Black Night Software in
>one
>>> of your conversation on this earlier)
>>>> {"error":"You must specify a id value for the listBatchSubscribe
>>> method","code":-90})
>>>>  I'm sure, I have the correct ID.  I'm able to use
>>>>  $mychimp->lists  and display the ID (and also Web_ID,
>>>>which I tried as well).
>>>>   Anybody out there who implemented MC successfully with
>>>>lasso 9 ?
>>>>   Thanks, Pavel
>>>>    #############################################################
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list Lasso
>>>> [hidden email]
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>    #############################################################
>>> This message is sent to you because you are subscribed to
>>>  the mailing list Lasso
>>> [hidden email]
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>Steve Piercy               Web Site Builder               Soquel, CA
>><[hidden email]>                  <http://www.StevePiercy.com/>
>>
>>
>>#############################################################
>>This message is sent to you because you are subscribed to
>>the mailing list Lasso
>>[hidden email]
>>To unsubscribe, E-mail to: <[hidden email]>
>>Send administrative queries to  <[hidden email]>
>
>
>#############################################################
>This message is sent to you because you are subscribed to
>the mailing list Lasso
>[hidden email]
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy               Web Site Builder              
Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>


#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MailChimp

Anibal Escobar
In reply to this post by Anibal Escobar
I have a server with L9 on it, so I thought I would try on that one.  Here's what works on L9:

        local('json_data'=map('id'=array('id'), 'apikey'='mykey-us3'))
        include_url('https://us3.api.mailchimp.com/2.0/lists/merge-vars.json', -postparams=json_serialize(#json_data))

On L8.5.6

        local('json_data'=map('id'=array('id'), 'apikey'='mykey-us3'))
        include_url('https://us3.api.mailchimp.com/2.0/lists/merge-vars.json', -postparams=encode_json(#json_data));

Results in the following error

"error":"You must specify a apikey value"

Interestingly,

         include_url('https://us3.api.mailchimp.com/2.0/lists/merge-vars.json', -postparams=map('apikey'='mykey-us3', 'id'=encode_json(array('id'))));

results in:

"error":"Validation error: {\"id\":\"Please enter an array\"}"

So I'm stumped.

Thanks,
Anibal Escobar
[hidden email]




On Nov 5, 2013, at 5:20 PM, Anibal Escobar <[hidden email]> wrote:

> I'm on 8.5.6.  I tried sending 'id'=encode_json(array('id')) and same error.  I'm wondering whether I should try using XML instead of JSON.  Any thoughts?
>
> Thanks,
> Anibal Escobar
> [hidden email]
>
>
>
>
> On Nov 5, 2013, at 4:21 PM, Brad Lindsay <[hidden email]> wrote:
>
>> On 11/5/13, 4:07 PM, Anibal Escobar wrote:
>>> Here's another question.  I'm using include_url to debug these connections, so I have:
>>>
>>> include_url('https://us3.api.mailchimp.com/2.0/lists/merge-vars.json', -postparams=array('apikey'='mykey-us3', 'id'=array('id')));
>>>
>>> according to the mailchimp api, the id parameter must be an array.  The code above produces
>>>
>>> Validation error: {\"id\":\"Please enter an array\"}"}
>>>
>>> so I'm guessing I'm using the wrong format to send an array as a param with postparams.  Any suggestions?
>>
>> Probably needs to be a JSON array:
>>
>> include_url(
>> 'https://us3.api.mailchimp.com/2.0/lists/merge-vars.json',
>> -postparams=array('apikey'='mykey-us3', 'id'=encode_json(array('id')))
>> );
>>
>> (I'm assuming this is 8.6, hence the encode_json)
>>
>>
>> Brad
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso
>> [hidden email]
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MailChimp

stevepiercy
In reply to this post by Anibal Escobar
Ah, yeah...  that bit me, too.  Try ->trim on the response?

--steve


On 11/5/13 at 12:51 PM, [hidden email] (Anibal Escobar) pronounced:

> Thanks again for your pointer!  It turns out that the mailchimp response has a
> leading line feed character.  This is why Jason's code didn't do the following:
>
>       if(#response && (#response->beginswith('[') || #response->beginswith('{'))
> && self->'output' == 'json');
>           #response = decode_json(#response);
>
> once I remove the leading line feed, decode_json works as expected.
>
> Thanks,
> Anibal Escobar
> [hidden email]
>
>
>
>
> On Nov 5, 2013, at 12:20 PM, Steve Piercy - Web Site Builder <[hidden email]>
> wrote:
>
> > That's odd.  Try:
> >
> > decode_json(string($mychimp->helper_ping));
> >
> > Also view source of the empty page.  If the result is HTML or XML, you won't see
> it.
> >
> > FWIW:
> >
> >    local('j' = bytes('{"msg":"Everythings Chimpy!"}'));
> >    decode_json(#j);
> >
> > => map: (msg)=(Everythings Chimpy!)
> >
> > --steve
> >
> >
> > On 11/5/13 at 11:55 AM, [hidden email] (Anibal Escobar) pronounced:
> >
> >> Now i'm stuck reading the response from mailchimp.  The following code:
> >>
> >>  decode_json($mychimp->helper_ping);
> >>
> >> results in an empty page
> >>
> >> $mychimp->helper_ping by itself returns:
> >>
> >> {"msg":"Everything's Chimpy!"} and is type bytes.
> >>
> >> Thanks,
> >> Anibal Escobar
> >> [hidden email]
> >>
> >>
> >>
> >>
> >> On Nov 5, 2013, at 11:28 AM, Anibal Escobar <[hidden email]> wrote:
> >>
> >>> Thanks so much for your suggestion!  There's one more change from version 1.3
> to
> >> 2.0 to deal with, namely that the method and output are not sent as url get
> >> parameters, but as part of the url.  I modified the custom tag with:
> >>>
> >>>        local('tmethod'=#method);
> >>>        #tmethod->replace('_','/');
> >>>        local('uri') = self->'url' + '/' + self->'version' +
> >> '/'+#tmethod+'.'+self->'output';
> >>>
> >>> to replace:
> >>>
> >>>        local('uri') = self->'url' + '/' + self->'version' + '/';
> >>>        #uri += '?output=' + self->'output' + '&method=' + #method;
> >>>
> >>> and it now works.
> >>>
> >>> Thanks,
> >>> Anibal Escobar
> >>> [hidden email]
> >>>
> >>>
> >>>
> >>>
> >>> On Nov 5, 2013, at 11:03 AM, Steve Piercy - Web Site Builder
> >> <[hidden email]> wrote:
> >>>
> >>>> Lasso methods cannot have "/" in their names.  Suggest using "_" instead.
> >>>>
> >>>> Then replace "_" with "/" and append it to the URL to get your API method.
> >>>>
> >>>> I'm probably leaving out a few details, but hopefully that gets you started.
> >>>>
> >>>> --steve
> >>>>
> >>>>
> >>>> On 11/5/13 at 10:41 AM, [hidden email] (Anibal Escobar) pronounced:
> >>>>
> >>>>> Hi, I'm trying to get the mailchimp tag to work as well.  I've modified Jason
> >>>>> Huck's tag to include the correct url and version:
> >>>>>
> >>>>> local(
> >>>>>    'apikey' = string,
> >>>>>    'output' = 'json',
> >>>>>    'url' = 'https://us3.api.mailchimp.com',
> >>>>>    'version' = 2.0    
> >>>>> );
> >>>>>
> >>>>> However, when I run
> >>>>>
> >>>>> var('mychimp') = mailchimp( -key='mykey-us3', -output='json');
> >>>>> $mychimp->ping;
> >>>>>
> >>>>> I get the following error:
> >>>>>
> >>>>> faultCode -32601 faultString Unknown method "/"
> >>>>>
> >>>>> It looks like for version 2.0, the method names have changed, so for example,
> >> it
> >>>>> looks like ping is now helper/ping.  However, doing
> >>>>>
> >>>>> $mychimp->helper/ping; throws an error
> >>>>> and
> >>>>> $mychimp->('helper/ping'); returns
> >>>>> \_global__current__unknowntag
> >>>>>
> >>>>> Any thoughts on how to do this?
> >>>>>
> >>>>> Thanks,
> >>>>> Anibal Escobar
> >>>>> [hidden email]
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>> On Feb 23, 2013, at 12:41 AM, [hidden email] wrote:
> >>>>>
> >>>>>> Steve,
> >>>>>> The lasso 8 tag from Jason Huck did not work as is, however after a few
> >>>>> modifications of the URL, (addressing some changes and updates from MC API
> >> pages)
> >>>>> I'm able to get "Everything's Chimpy!" response after issuing the
> >> $mychimp->ping.
> >>>>>>
> >>>>>> Interestingly I'm getting the same error as Stephen (Black Night Software in
> >> one
> >>>>> of your conversation on this earlier)
> >>>>>> {"error":"You must specify a id value for the listBatchSubscribe
> >>>>> method","code":-90})
> >>>>>> I'm sure, I have the correct ID.
> >>>>>> I'm able to use
> >>>>>> $mychimp->lists
> >>>>>> and display the ID (and also Web_ID, which I tried as well).
> >>>>>>
> >>>>>> Anybody out there who implemented MC successfully with lasso 9 ?
> >>>>>>
> >>>>>> Thanks, Pavel
> >>>>>>
> >>>>>>
> >>>>>> #############################################################
> >>>>>> This message is sent to you because you are subscribed to
> >>>>>> the mailing list Lasso
> >>>>>> [hidden email]
> >>>>>> To unsubscribe, E-mail to: <[hidden email]>
> >>>>>> Send administrative queries to  <[hidden email]>
> >>>>>
> >>>>>
> >>>>> #############################################################
> >>>>> This message is sent to you because you are subscribed to
> >>>>> the mailing list Lasso
> >>>>> [hidden email]
> >>>>> To unsubscribe, E-mail to: <[hidden email]>
> >>>>> Send administrative queries to  <[hidden email]>
> >>>>
> >>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> >>>> Steve Piercy               Web Site Builder               Soquel, CA
> >>>> <[hidden email]>                  <http://www.StevePiercy.com/>
> >>>>
> >>>>
> >>>> #############################################################
> >>>> This message is sent to you because you are subscribed to
> >>>> the mailing list Lasso
> >>>> [hidden email]
> >>>> To unsubscribe, E-mail to: <[hidden email]>
> >>>> Send administrative queries to  <[hidden email]>
> >>>
> >>>
> >>> #############################################################
> >>> This message is sent to you because you are subscribed to
> >>> the mailing list Lasso
> >>> [hidden email]
> >>> To unsubscribe, E-mail to: <[hidden email]>
> >>> Send administrative queries to  <[hidden email]>
> >>
> >>
> >> #############################################################
> >> This message is sent to you because you are subscribed to
> >>  the mailing list Lasso
> >> [hidden email]
> >> To unsubscribe, E-mail to: <[hidden email]>
> >> Send administrative queries to  <[hidden email]>
> >
> > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> > Steve Piercy               Web Site Builder               Soquel, CA
> > <[hidden email]>                  <http://www.StevePiercy.com/>
> >
> >
> > #############################################################
> > This message is sent to you because you are subscribed to
> >  the mailing list Lasso
> > [hidden email]
> > To unsubscribe, E-mail to: <[hidden email]>
> > Send administrative queries to  <[hidden email]>
>
>
> #############################################################
> This message is sent to you because you are subscribed to
>   the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy               Web Site Builder               Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>


#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MailChimp

stevepiercy
In reply to this post by Anibal Escobar
Ah, you may have a old version of encode/decode_json.  Perhaps
grab a more current version?
http://www.lassosoft.com/Lasso-Professional-86-Change-Notes

Unfortunately, something is whacked with searching lassosoft.com
and search engines return too many results.

Argh.  This used to work.
http://lasso.2283332.n4.nabble.com/JSON-Tags-td3151568.html
http://www.lassosoft.com/downloads_browse/TotW/

Maybe if you download the latest version of 8.6 and extract
JSON.lasso or JSON7.lasso from the package?

--steve


On 11/5/13 at 5:20 PM, [hidden email] (Anibal Escobar) pronounced:

>I'm on 8.5.6.  I tried sending 'id'=encode_json(array('id'))
>and same error.  I'm wondering whether I should try using XML
>instead of JSON.  Any thoughts?
>
>Thanks,
>Anibal Escobar
>[hidden email]
>
>
>
>
>On Nov 5, 2013, at 4:21 PM, Brad Lindsay <[hidden email]> wrote:
>
>>On 11/5/13, 4:07 PM, Anibal Escobar wrote:
>>> Here's another question.  I'm using include_url to debug these connections, so I
>have:
>>>   include_url('https://us3.api.mailchimp.com/2.0/lists/merge-vars.json',
>-postparams=array('apikey'='mykey-us3', 'id'=array('id')));
>>>   according to the mailchimp api, the id parameter must be
>>>an array.  The code
>above produces
>>>   Validation error: {\"id\":\"Please enter an array\"}"}
>>>   so I'm guessing I'm using the wrong format to send an
>>>array as a param with
>postparams.  Any suggestions?
>>
>>Probably needs to be a JSON array:
>>
>>include_url(
>>'https://us3.api.mailchimp.com/2.0/lists/merge-vars.json',
>>-postparams=array('apikey'='mykey-us3', 'id'=encode_json(array('id')))
>>);
>>
>>(I'm assuming this is 8.6, hence the encode_json)
>>
>>
>>Brad
>>
>>#############################################################
>>This message is sent to you because you are subscribed to
>>the mailing list Lasso
>>[hidden email]
>>To unsubscribe, E-mail to: <[hidden email]>
>>Send administrative queries to  <[hidden email]>
>
>
>#############################################################
>This message is sent to you because you are subscribed to
>the mailing list Lasso
>[hidden email]
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy               Web Site Builder              
Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>


#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MailChimp

stevepiercy
In reply to this post by Anibal Escobar
Actually, I think the array is neither a Lasso nor JSON array,
but must be formatted for GET params.
https://groups.google.com/forum/#!topic/mailchimp-api-discuss/B1T0AaPz4rY

--steve


On 11/5/13 at 5:20 PM, [hidden email] (Anibal Escobar) pronounced:

>I'm on 8.5.6.  I tried sending 'id'=encode_json(array('id'))
>and same error.  I'm wondering whether I should try using XML
>instead of JSON.  Any thoughts?
>
>Thanks,
>Anibal Escobar
>[hidden email]
>
>
>
>
>On Nov 5, 2013, at 4:21 PM, Brad Lindsay <[hidden email]> wrote:
>
>>On 11/5/13, 4:07 PM, Anibal Escobar wrote:
>>> Here's another question.  I'm using include_url to debug these connections, so I
>have:
>>>   include_url('https://us3.api.mailchimp.com/2.0/lists/merge-vars.json',
>-postparams=array('apikey'='mykey-us3', 'id'=array('id')));
>>>   according to the mailchimp api, the id parameter must be
>>>an array.  The code
>above produces
>>>   Validation error: {\"id\":\"Please enter an array\"}"}
>>>   so I'm guessing I'm using the wrong format to send an
>>>array as a param with
>postparams.  Any suggestions?
>>
>>Probably needs to be a JSON array:
>>
>>include_url(
>>'https://us3.api.mailchimp.com/2.0/lists/merge-vars.json',
>>-postparams=array('apikey'='mykey-us3', 'id'=encode_json(array('id')))
>>);
>>
>>(I'm assuming this is 8.6, hence the encode_json)
>>
>>
>>Brad
>>
>>#############################################################
>>This message is sent to you because you are subscribed to
>>the mailing list Lasso
>>[hidden email]
>>To unsubscribe, E-mail to: <[hidden email]>
>>Send administrative queries to  <[hidden email]>
>
>
>#############################################################
>This message is sent to you because you are subscribed to
>the mailing list Lasso
>[hidden email]
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy               Web Site Builder              
Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>


#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
12