Jump to content

How do I search Databases via API?


Go to solution Solved by Sonya*,

Recommended Posts

I want to search a title in a database to make sure the record is not already there.   I found the different search types I can do:

    "contenttypes": [
        "core_statuses_status",
        "calendar_event",
        "cms_pages_pageitem",
        "cms_records1",
        "cms_records2",
        "forums_topic",
        "nexus_package_item",
        "links_link"
    ]

What contenttype do I use if I want to search database #3?

Edited by Elon Report
Link to comment
Share on other sites

  • Elon Report changed the title to How do I search Databases via API?
7 hours ago, Stuart Silvester said:

Are you using OAuth tokens? If so, the member you're connecting as most likely doesn't have permission to see the database.

No, I am using REST API.   I tried cms_records3, but that did not work.   

Link to comment
Share on other sites

Posted (edited)
58 minutes ago, Sonya* said:

You need a page. The database itself has no url, the page has. If there is no URL, nothing can be accessed or searched.

That was the solution!   I was able to create records without a url though.

For anyone else that stumbles with this issue:

My database id is 3.   My new page id is 4.

The contenttype is cms_records3

Thanks all.

Edited by Elon Report
Link to comment
Share on other sites

Posted (edited)

OK, I am now trying to search actual data, and running into an issue.  Was going to start a new thread but this one was at the top.  🙂

I have a database (#4) on a page, and I am able to upload a record to it.   I can see it on the page. However, I always get no results found via the api.

{{base_url}}?/core/search&q=2&type=cms_records4
{
    "page": 1,
    "perPage": 25,
    "totalResults": 0,
    "totalPages": 0,
    "results": []
}

The title is "2".  I've tried playing with variables but nothing gets returned when there are no filters at all!

Edited by Elon Report
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...