Jump to content
Sign in to follow this  
Followers 2
Goldenhawk

Using API to get user GUID, not just referenceCode

Recommended Posts

In the new API, I don't see any means of looking up a cache owner's GUID, which is how MOST pages on geocaching.com identify users. For example, the send-an-email tool has long used the GUID to open a page to email the user:

https://www.geocaching.com/email/?guid=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXX

and the user's profile page also expects a GUID:

https://www.geocaching.com/profile/?guid=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXX

 

I can't figure out any way to get the GUID properly. As a workaround, I can get the profile URL in a format like

https://coord.info/XXXXXXX

(where XXXXXX is the API's new Base31 user ID code) which when opened jumps directly to the GUID format page instead. I can extract the GUID from the forwarding page, but that's a hack and I don't trust it to work forever.

 

I also found I can get to the email tool like this:

https://www.geocaching.com/email/?usercode=XXXXXX

 

Seems kinda random...

 

Any ideas?

Share this post


Link to post

You don't. There is no guid anymore, at least as far as the API is concerned. There really is no reason for it either as you're supposed to use the API and not scrape the website. The API has everything you should need that Groundspeak HQ wants/allows you to get.

 

Also, that, "new Base31 user ID code" is not new, it's been around since day 1 of the API (both old and new). You can easily convert from the code to the number and back. How to do so is documented at https://api.Groundspeak.com/documentation (Look in Overview, Reference Codes).

Share this post


Link to post

It's not about scraping the website: it's about directing the user to the appropriate web pages for their own purposes.

 

I understand the code is not new, but it's not been the primary focus. Everything on the public-facing website (the user profile and the email tool and numerous other places) uses the GUID. It seems kind of schizophrenic to me.

 

 

Share this post


Link to post

I guess I don't understand what you're getting at here. To direct users to web pages on geocaching.com, you just use the https://coord.info/XXXXX. That's been the proper way to do so for years. Also, only premium members should be allowed to go to any of those pages on geocaching.com, while non premium members should be directed to upgrade to premium. I haven't verified, but I don't think partner apps should be using the email tool either. You may want to verify that with Groundspeak HQ.

Share this post


Link to post

Again, I'm NOT using the email tool. I'm simply giving my users the link to get to that tool if they wish. They could visit the cache page, click the owner's name to view the owner's profile page, or click the "Message this owner" link to send an email. Both are options available to EVERY cacher, premium or not, and I'm simply providing a simpler and more convenient way for my users to reach those public-facing web pages.

 

But those links on the geocaching.com website BOTH use GUIDs.

https://www.geocaching.com/profile/?guid=7ab7db89-75d1-4921-ab4b-e87be5ef0835&wid=dbc8e907-583e-4c08-bf0c-d62fc6b1bb46&ds=2

https://www.geocaching.com/account/messagecenter?recipientId=7ab7db89-75d1-4921-ab4b-e87be5ef0835&gcCode=GC4Q7HV

Hence my frustration and confusion.

Share this post


Link to post

Is there some benefit to the username link, instead of the referenceCode version? I don't care which, but if I'm already tracking the referenceCode for their profile it seems just as legit.

 

I hope I'm not sounding defensive; I'm just trying to understand the logic and thought process.

Share this post


Link to post
5 minutes ago, Goldenhawk said:

Is there some benefit to the username link, instead of the referenceCode version?

No. Actually you posted links with guids. And, as the new API doesn't know anything about guids, hence my tip using the name instead.

Share this post


Link to post
1 hour ago, SpiritGuide said:

 

Does it work for the message center link?

I'll let you know when I'm done testing. Right now I'm still working within the staging API and I don't feel confident in answering.

 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  
Followers 2

×
×
  • Create New...