Jump to content

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?

Link to comment

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).

Link to comment

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.

 

 

Link to comment

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.

Link to comment

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.

Link to comment

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.

Link to comment
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.

Link to comment
On 6/29/2019 at 4:38 AM, Goldenhawk said:

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.

 

As @Goldenhawk never let us know his test findings, I have been creating some Custom URLs in GSAK and have been searching for an answer on how GSAK could use its Special Tags to access the Message Center  for a specific user (Not their email). 

As @Goldenhawk indicated, we can get to every useful page for a specific user on the Geocaching site using the Owner Id instead of the Owner Guid and other special tags, except for the Message Center.

 

The Custom URL that gets nearest to that requirement is this:

https://www.geocaching.com/account/messagecenter

You are now in the Message Centre but not in the users specific conversation

However, you can now either:

  • Click on a user name in the left-hand column.
  • Type in the user name in the search text box at the top.

So now I have a Custom URL with the name Message Centre, in a folder named GC.com, created like this:

GC.com\Message Centre=https://www.geocaching.com/account/messagecenter?%OwnerName

 

Following the link opens the Message Centre but not in a conversation with the specific Owner.

However, the Owner Name is displayed in the Address bar ready to be copy/pasted into the search box.

 

Now, in GSAK, selecting this Custom URL opens the Message Centre for the currently selected cache, whose Owner is JoeBloggs and the address bar displays https://www.geocaching.com/account/messagecenter?JoeBloggs.

 

A quick copy/paste of JoeBloggs into the search bar creates a conversation with the user.

 

As it appears, there is no way of getting the Users GUID from the API, I believe this is the best we can do, unless anyone knows better.

Link to comment

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...
×
×
  • Create New...