Change Request : V3 event update - allow POST as well as PATCH

58 views
Skip to first unread message

Andrew Murphy

unread,
Feb 26, 2017, 2:15:14 PM2/26/17
to Meetup API
Hi
The library I'm using (perl's LWP::UserAgent)  just has GET POST DELETE etc. but not PATCH
So its fine for the V2 update event
But V3 update event uses PATCH..
Could it use POST as well
Thanks
Andrew

Doug Tangren

unread,
Feb 26, 2017, 2:25:57 PM2/26/17
to meetu...@googlegroups.com
Hi Andrew,

Would it work if you constructed an Http::Request ( http://search.cpan.org/~ether/HTTP-Message-6.11/lib/HTTP/Request.pm ) directly? It looks like you can pass the HTTP method directly into that type's constructor. I looks like you can then pass that to instance's of perl's UserAgents.
 

--
--
You received this message because you are subscribed to the Google
Groups "Meetup API" group.
To unsubscribe from this group, send email to
meetup-api+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/meetup-api?hl=en?hl=en

---
You received this message because you are subscribed to the Google Groups "Meetup API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetup-api+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Doug Tangren

unread,
Feb 26, 2017, 2:29:08 PM2/26/17
to meetu...@googlegroups.com
On Sun, Feb 26, 2017 at 2:25 PM, Doug Tangren <do...@meetup.com> wrote:

On Mon, Feb 20, 2017 at 5:37 PM, Andrew Murphy <aavm...@gmail.com> wrote:
Hi
The library I'm using (perl's LWP::UserAgent)  just has GET POST DELETE etc. but not PATCH
So its fine for the V2 update event
But V3 update event uses PATCH..
Could it use POST as well
Thanks
Andrew

Hi Andrew,

Would it work if you constructed an Http::Request ( http://search.cpan.org/~ether/HTTP-Message-6.11/lib/HTTP/Request.pm ) directly? It looks like you can pass the HTTP method directly into that type's constructor. I looks like you can then pass that to instance's of perl's UserAgents.

Something like

require HTTP::Request;
$request = HTTP::Request->new(PATCH => 'https://api.meetup.com/{your-group}/events/{event_id}');

Andrew Murphy

unread,
Mar 23, 2017, 9:03:39 AM3/23/17
to Meetup API
Thanks for the suggestion. I'll have a try.
In the meantime, I also raised an issue with perl's LWP module to add 'PATCH'. 
Its been accepted, and is targeted for the next release.
Andrew

Doug Tangren

unread,
Mar 23, 2017, 9:25:06 AM3/23/17
to meetup-api


On Mar 23, 2017 9:03 AM, "Andrew Murphy" <aavm...@gmail.com> wrote:
Thanks for the suggestion. I'll have a try.
In the meantime, I also raised an issue with perl's LWP module to add 'PATCH'. 
Its been accepted, and is targeted for the next release.
Andrew

Nice. Happy to be a motivator.


On Sunday, 26 February 2017 19:29:08 UTC, Doug Tangren wrote:


On Sun, Feb 26, 2017 at 2:25 PM, Doug Tangren <do...@meetup.com> wrote:


On Mon, Feb 20, 2017 at 5:37 PM, Andrew Murphy <aavm...@gmail.com> wrote:
Hi
The library I'm using (perl's LWP::UserAgent)  just has GET POST DELETE etc. but not PATCH
So its fine for the V2 update event
But V3 update event uses PATCH..
Could it use POST as well
Thanks
Andrew

Hi Andrew,

Would it work if you constructed an Http::Request ( http://search.cpan.org/~ether/HTTP-Message-6.11/lib/HTTP/Request.pm ) directly? It looks like you can pass the HTTP method directly into that type's constructor. I looks like you can then pass that to instance's of perl's UserAgents.

Something like

require HTTP::Request;
$request = HTTP::Request->new(PATCH => 'https://api.meetup.com/{your-group}/events/{event_id}');
 

--

Jonathan C

unread,
Jan 10, 2018, 7:08:18 AM1/10/18
to Meetup API
Andrew: Did you get this to work? I have been unable to get PATCH to work even with HTTP::Request. Specifically, I'm trying to set the "lon" and "lat" of an event, but I use the "key" authentication method. Whereas I could use v2 methods with POST, the v3 PATCH is not working, either because it may not accept "key" auth (I can't be sure in docs), or maybe I have the JSON body incorrect.

How did you finally get it to work?
Which auth method used?

Thx,
Jonathan

Andrew Murphy

unread,
Jan 29, 2018, 6:10:51 PM1/29/18
to Meetup API
Hi,
yes and no
i did get PATCH to work. You need the latest version of HTTP::Request::Common;
but there were a few undocumented gotchas
i seem to remember something like you could create an event with a lat/lon, but then you couldnt update that event with v3 PATCH
so i stuck to creating venue id's manually, and hard-coding them into my script
i only use key authentication

use LWP::UserAgent;
use HTTP::Request::Common;
use JSON;

$url =  "https://api.meetup.com/$MEETUP_GROUP_URL}/events" . ( $s_event_new ? "" : "/$meetup_id" ) ;

#NB: in %fields, $fields{time} is unix_time * 1,000

$ua
= LWP::UserAgent->new();
$request
= HTTP::Request::Common::PATCH( $url, [ %fields ] );

$response  
= $ua->request( $request );
$http_status_code    
= $response->code();
$content
= $response->decoded_content();
$data   
= eval{ from_json ( $content ) };



Jonathan C

unread,
Jan 29, 2018, 7:10:52 PM1/29/18
to Meetup API
Andrew: Thanks. For now I'll stick with v2 POST which I got working. Will keep these notes for when I have to move to v3 APIs.
Reply all
Reply to author
Forward
0 new messages