myJson
HomeApp
myJson v2
myJson v2
  • Get Started
  • Terminology
    • Record
    • Collection
  • Endpoints
    • Records
    • Collections
Powered by GitBook
On this page
  • Get all records
  • Return all records from the collection

Was this helpful?

  1. Endpoints

Collections

The route is designed to be resource-oriented and follows standard HTTP verbs.

Get all records

Return all records from the collection

GET https://api.myjson.online/v1/collections/:collectionId/records

Path Parameters

Name
Type
Description

collectionId*

String

Headers

Name
Type
Description

x-collection-access-token

String

x-record-metadata

true | false

default to true, return metadata

{
    records: [{ data, id }]
}
{
    error: "Bad Request",
    message: "Invalid request"
}
// Javascript example
var myHeaders = new Headers();
myHeaders.append("x-collection-access-token", "YOUR_COLLECTION_ACCESS_TOKEN");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://api.myjson.online/v1/collections/YOUR_COLLECTION_ID/records", requestOptions)
  .then(response => response.json())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
PreviousRecords

Last updated 2 years ago

Was this helpful?