Jump to content

create/save PQ through the API


Ange Heureux

Recommended Posts

Hi,

 

Is it possible to add in the API the possibility to save a PQ ? For the moment is it possible to create/run a PQ, but not to save under the account of the user a new PQ ....

 

Thanks in advance,

 

Ange

I'm not sure what you mean. Currently there's no way to create or run a PQ using the API. You can only download the results of a PQ that has already run.

 

...and assuming you could already create or run a PQ using the API, what would "save" mean? How is this different from creating a PQ? Maybe it's a language thing, but these would seem to be equivalent.

Link to comment

Hi,

 

Is it possible to add in the API the possibility to save a PQ ? For the moment is it possible to create/run a PQ, but not to save under the account of the user a new PQ ....

 

Thanks in advance,

 

Ange

I'm not sure what you mean. Currently there's no way to create or run a PQ using the API. You can only download the results of a PQ that has already run.

 

...and assuming you could already create or run a PQ using the API, what would "save" mean? How is this different from creating a PQ? Maybe it's a language thing, but these would seem to be equivalent.

A better question might be why would you want to mess with PQ's at all when the API for GetGeocaches provides the functionality of a PQ?

Link to comment

Hi,

 

Is it possible to add in the API the possibility to save a PQ ? For the moment is it possible to create/run a PQ, but not to save under the account of the user a new PQ ....

 

Thanks in advance,

 

Ange

I'm not sure what you mean. Currently there's no way to create or run a PQ using the API. You can only download the results of a PQ that has already run.

 

...and assuming you could already create or run a PQ using the API, what would "save" mean? How is this different from creating a PQ? Maybe it's a language thing, but these would seem to be equivalent.

A better question might be why would you want to mess with PQ's at all when the API for GetGeocaches provides the functionality of a PQ?

 

I wish the API was as functional as a PQ

 

I started to mess around with the SearchForGeocaches API call inside a GSAK macro and very quickly got it to barf this:

 

Range specified is longer than allowed. Range must be less than 30 days.

Link to comment

I don't understand your statement. The API is vastly superior than the PQ. You can search on so many variables that will never be available on the pq. Why would you want to use a PQ when you can save the criteria for each query and run it as needed. The only hitch isn't you can't schedule them for regular running.

 

Are you using your own call or GSAKs interface?

 

You don't say what part of the call returned that error.

 

Lastly it would be better to address this in GSAKs forum.

Link to comment

I don't understand your statement. The API is vastly superior than the PQ. You can search on so many variables that will never be available on the pq. Why would you want to use a PQ when you can save the criteria for each query and run it as needed. The only hitch isn't you can't schedule them for regular running.

 

Are you using your own call or GSAKs interface?

 

You don't say what part of the call returned that error.

 

Lastly it would be better to address this in GSAKs forum.

 

Sorry -- that was very unspecific of me. Below is the code that generated the error; I was trying to use the call to find all T5 caches published before a certain date in a fixed radius circle.

 

I don't think its a GSAK issue -- that's just the easiest mechanism to get at the API.

 

It appears there is a timeframe limitation on that API call, which severely restricts it as a PQ replacement.

 

 

$data = gcapi("SearchForGeocaches",$search)
if $_GcApiError
# error running api so show error message
msgok msg=$data
else
# api OK now do what you want with the return data
clip data=$data
$data = sqlite("sql","select data from GcApi","headings=Y")
$output = sqltohtml($data,"Test","y")



endif

<data> Varname=$search
<SearchForGeocachesRequest xmlns="http://www.geocaching.com/Geocaching.Live/data">
 <AccessToken>{AccessToken}</AccessToken>
 <IsLite>true</IsLite>
 <MaxPerPage>5</MaxPerPage>
 <GeocacheLogCount>5</GeocacheLogCount>
 <TrackableLogCount>5</TrackableLogCount>
 <PointRadius>
   <DistanceInMeters xmlns="http://schemas.datacontract.org/2004/07/Tucson.Geocaching.WCF.API.Geocaching.Types">1000000</DistanceInMeters>
   <Point xmlns="http://schemas.datacontract.org/2004/07/Tucson.Geocaching.WCF.API.Geocaching.Types">
     <Latitude xmlns="http://schemas.datacontract.org/2004/07/Tucson.Geocaching.WCF.API.Utilities">43.8</Latitude>
     <Longitude xmlns="http://schemas.datacontract.org/2004/07/Tucson.Geocaching.WCF.API.Utilities">-79.4</Longitude>
   </Point>
 </PointRadius>
<Terrain>
   <MinTerrain xmlns="http://schemas.datacontract.org/2004/07/Tucson.Geocaching.WCF.API.Geocaching.Types">5</MinTerrain>
   <MaxTerrain xmlns="http://schemas.datacontract.org/2004/07/Tucson.Geocaching.WCF.API.Geocaching.Types">5</MaxTerrain>
 </Terrain>
 <CachePublishedDate>
   <Range xmlns="http://schemas.datacontract.org/2004/07/Tucson.Geocaching.WCF.API.Geocaching.Types">
     <StartDate xmlns="http://www.geocaching.com/Geocaching.Live/data">1999-05-31T11:20:00</StartDate>
     <EndDate xmlns="http://www.geocaching.com/Geocaching.Live/data">2008-04-08T00:00:00</EndDate>
   </Range>
 </CachePublishedDate>
</SearchForGeocachesRequest>
<enddata>

Link to comment

I'm not sure what you mean. Currently there's no way to create or run a PQ using the API. You can only download the results of a PQ that has already run.

...and assuming you could already create or run a PQ using the API, what would "save" mean? How is this different from creating a PQ? Maybe it's a language thing, but these would seem to be equivalent.

 

Hi,

I need to create a PQ through the API (is already possible), but *store/save* the conditions of the PQ (so a new PQ) for a later use, typically to permit to an user, which have the geocaching app on an iPhone, to download the PQ. (the PQ is the only system permit by apple to download a set of caches selected by specific conditions)

 

Thanks,

 

Ange

Link to comment

I need to create a PQ through the API (is already possible)...

What software are you using that allows this? I don't know of any software that allows you to use the API to create a PQ.

 

Here's the API documentation, and the only calls that deal with PQs are the ones that retrieve data from PQs that have already been created through the website. If you're able to create a PQ using the API, please describe how you're doing so, because I think you've found an undocumented feature.

Link to comment
I was trying to use the call to find all T5 caches published before a certain date in a fixed radius circle.

How many T5 caches can there possibly be in your area, regardless of publish date?

 

Just get all of them, then filter in GSAK.

 

It's not what I am trying to query for that is relevant here -- that example was a test of concept. And it didn't get very far, when I ran up against temporal limitations on the API call. In the context of replacing PQs with API calls, this would make it a non-starter, no?

Link to comment

Only if you wanted to do the placed by. Searching for T5 or whatever criteria is allowed and I am guessing you could then create the pq.

 

If the PQ can do placed-by then the API should also be able to do it. This is the presumption I am making based on assertions that the PQ interface will not be changed/enhanced/fixed and that the API is the "wave of the future"

 

I was testing to see if this is the case, and I think it isn't (yet).

Link to comment

What software are you using that allows this? I don't know of any software that allows you to use the API to create a PQ.

 

The post about store PQ was created in order to add this function to the soft iCaching (on Mac), which proposes to do directly quite a PQ (we obtain a set of caches directly downloaded in the soft and i wanted to propose to store the condition of the PQ under my account as real PQ.

But an another example is on this page : make PQ

 

Regards

 

Ange

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