Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the CollectiveAccess support forum! Here the developers and community answer questions related to use of the software. Please include the following information in every new issue posted here:

  1. Version of the software that is used, along with browser and version

  2. If the issue pertains to Providence, Pawtucket or both

  3. What steps you’ve taken to try to resolve the issue

  4. Screenshots demonstrating the issue

  5. The relevant sections of your installation profile or configuration including the codes and settings defined for your local elements.


If your question pertains to data import or export, please also include:

  1. Data sample

  2. Your mapping


Answers may be delayed for posts that do not include sufficient information.

API:Getting Data - georeference ??

edited November 7 in Troubleshooting

I want to produce an extra leaflet map to show markers for all objects (= historic pictures) of the database.
I need the lat/long data and the id for each object in an array.
Starting to work myself through the "API:Getting Data", I still have difficulties to understand how to use the different options to get data.

1. Is the DB Class the appropriate tool?

I can do the simple search querys using the DB class like: SELECT * FROM ca_objects, but it doesn't work with "ca_objects.georeference". I get the error message:
SELECT command denied to user '....@'localhost' for table 'georeference' in ..../ca/pawtucket/app/lib/Db/mysqli.php line 316:

Because the DB class can't do it? How can I get the lat/long through this kind of query?

**** 2.Getting data from model instances and search results****

When I use the search engine with the examples from the help page ($o_search = new ObjectSearch();) I get a the 500 error message on the front end.
What kind of configuration is missing in this case? I know it is mentioned somewhere, but I haven't found it.

Is "ca_objects.georeference" here the right bundle specifier (if that is the right term)?

Thank you very much for your help!

Comments

  • Where are you wanting to show this map? Pawtucket already does this.

  • I thought pawtucket shows only the marker for one object. Therefore I made an additional subpage to use all functions of leaflet. One aim is to show all markers on the same map.

  • It'll also generate a map of search or browse results.

  • I have managed to get access to the API using Postman, and I can make get-requests with JSON results.
    I still want to use the search classes and I'm struggeling to get that working.
    My understanding is that the endpoint is in this case for example:

    https://...../ca/app/lib/search/ObjectSearch.php

    If that's right, then the question is to find a solution for the authentification. I found an example on github and put the credentials (with my data) in the body of the Postman request:

    define('CA_SERVICE_API_USER', 'administrator');
    define('CA_SERVICE_API_KEY', 'dublincore');

    That gives me the 403 error response.

    Do I still mix things up? What is wrong?

  • edited November 22

    The endpoint would be in the form https://...ca/service.php/Find/ca_objects?q=<search expression>

Sign In or Register to comment.