Tuesday, July 12, 2022

Sitecore Content Hub: Get asset using REST API

 API URL : api/entities/{id}


Description: We can get the asset and metadata from the Content hub. The get service will fetch the details with the input asset id. We can also use query parameter to control the response. If more than one assets are present with the same name in SCH then latest asset will be returned.

 

Parameters

Name

Located in

Description

Required

Schema

Authorization

Headers

Access token which is generated in Oauth api call insert in the header.

Yes

String

id

url

To fetch the asset details using the asset ID.

Yes

sting

members

Params

To get the specified properties from the response. Ex: members=Title,FileSize

No

sting

query

params

Query entities by generic properties of known datatypes

No

sting

take

params

skip and take parameters to page the results set.            To get the latest asset this parameter can be set to 1

No

sting

skip

params

skip and take parameters to page the results set

 

 

 

 

Responses:

 

If the request is successful asset details will be received in response with status code 200.

HTTP Status Code

Application Return Code

Description

Value

Schema

200

 

OK

-

String

304

 

Not Modified

-

String

400

 

Bad Request

-

String

403

 

Forbidden

-

String

404

 

Not Found

-

String

500

 

Server Error

 

String

 

Reference Screenshot – API call from postman tool:

 


No comments:

Post a Comment

How to Create a Public Link Using the Sitecore Content Hub REST API

Creating a public link using the Sitecore Content Hub REST API is a straightforward process that enables you to share content externally whi...