Loading...

Fetch Item

Description

This API enables you to fetch an item from a NoSQL table in your project. The table is referred to by its unique ID or name.

You can specify the attributes of the items to be fetched, and even denote if they need to be fetched from the master or a slave cluster.

Request Details

Request URL

GET

{api-domain}/baas/v1/project/{{project_id}}/nosqltable/{{table_identifier}}/item/fetch

copy

api-domain
URL
The DC-specific domain to access Catalyst API

project_id
Numerical
The unique ID of the project

tableIdentifier
Numerical
The unique ID of the table or table name

Request Headers

Authorization: Zoho-oauthtoken {oauth_token}
Content-Type: application/json

Optional Headers

CATALYST-ORG: {org_id}

Environment: Development

Scope

ZohoCatalyst.nosql.item.READ

Note: This operation can also be executed with Catalyst user authentication permissions using Catalyst SDKs. Refer to the Catalyst API Prerequisites section for details.

Request JSON Properties

keys json
mandatory
Denotes the partition key and sort key of the table.
required_attributes json
optional
List of attributes to be returned.
consistent_read json
optional
Declares if the read has to be done from master or slave. If set to false, it is queried from the slave. Accepted values: true, false.

Response Details

The response will return the status of the fetch operation, as well as the items that are fetched. Either all the attributes or specified attributes of the items will be fetched.

Sample Request
copy

curl -X GET
https://api.catalyst.zoho.com/baas/v1/project/4000000006007/nosqltable/3376000003171728/item/fetch
-H “Authorization: Zoho-oauthtoken 1000.910*************************16.2f*************************57”
-H “Content-Type:application/json”
-d ‘{ keys:{ partition_key:{ “S”:“Country” }, sort_key:{ “N”:“EmpID” }, } required_attributes: { “EmpID”, “FirstName”, “LastName”, “PriorExperience” }, consistent_read: “true” }’

Sample Response
copy
{
"status": "success",
"data": {
    fetched_attributes:{
"item": {
"EmpID": {
"N": "10999"
},
"FirstName":{
"S": "Paul"
},
"LastName":{
"S": "Smith"
},
"PriorExperience":{
"BOOL": false
}
}
}
}
}