Get a resource by its unique identifier (Example)

See https://crossmedia.atlassian.net/wiki/spaces/WD/pages/2208366593/Accessing+data#Get-a-resource-by-its-unique-identifier

Example

GET https://club-wed.wedia-group.com/api/rest/dam/data/asset/78j1ko1ds3my1

Get the 78j1ko1ds3my1identifier asset (Type of service: DAM).

Aliases

The following URIs will return the same resource (not all properties are identical, some may be contextual to the URI, especially the URLs for example).

End point access to resources of the same service type

If the type of resource is not known, it can be left out of the URI (i.e. asset here).

GET https://club-wed.wedia-group.com/api/rest/dam/data/78j1ko1ds3my1

Access through the end point of access to asset library resources

GET https://club-wed.wedia-group.com/api/rest/dam/asset/78j1ko1ds3my1

This alias works because the identifier used is that of an asset, which is obviously part of the asset libraries.

Access through the end point of access to dam resources

GET https://club-wed.wedia-group.com/api/rest/dam/78j1ko1ds3my1

This alias allows access to all resources exposed in the DAM service type by their unique identifier.

Code examples

The following examples are given with a Basic authentication with bogus credentials.

HTTP

GET /api/rest/dam/data/asset/78j1ko1ds3my1 HTTP/1.1 Authorization: Basic ZGVtbzpkZW1vcHdk Host: club-wed.wedia-group.com

cURL

curl --request GET --url 'https://club-wed.wedia-group.com/api/rest/dam/data/asset/78j1ko1ds3my1' --header 'Authorization: Basic ZGVtbzpkZW1vcHdk'

JavaScript/fetch

fetch("https://club-wed.wedia-group.com/api/rest/dam/data/asset/78j1ko1ds3my1", { "method": "GET", "headers": { "Authorization": "Basic ZGVtbzpkZW1vcHdk" } }) .then(response => { console.log(response); }) .catch(err => { console.error(err); });

JavaScript/XMLHttpRequest

Java/Unirest (Basic)

Python/Request

Response sample

Since the response may vary depending on the state of the data, the query parameters, the resource configuration, and the data model, a response is presented here that may be somewhat different from what you will get in your implementation. Not all sections are documented here for the same reasons. The debug sections in particular are not documented on this page.

Response

This documentation describes all the exposable properties. The documentation of the API (ReDoc or SwaggerUI) of the usage environment is more specific to the environment and will detail the information actually exposed on it.

JSON Path

The path to the property

Type*

Type of information

JSON Type

The type of the value

Description

The description of the value

Presence

When this property is exposed

Comment

JSON Path

The path to the property

Type*

Type of information

JSON Type

The type of the value

Description

The description of the value

Presence

When this property is exposed

Comment

$

STRUCT

Object

The response for end point invocation (root)

Always

 

$.resource

META

String

The resource type name

Always

 

$.name

META

String

Localized name of the resource type

Always

 

$.description

META

String

Localized description of the resource type

Always

This is the data titled Technical description in the configuration of the data structure

$.response

STRUCT

Object

Data specific to the call for service response

Always

 

$.links

AGPG

Object

HATEOAS Section

Always

 

$.version

TECH

String

Version of the API end point

Always

 

$.apiversion

TECH

String

Version of the API

Always

 

$.response.headers

STRUCT

Object

The headers

If parameter headers (or related parameters) is true

See details of this section here.

$.response.data

STRUCT

Object

Resource data

Always

 

$.response.data.<prop>

where <prop> is a resource property name

DATA

Miscellaneous

Depends of the property data type (see below)

Resource data value

Depends of the resource configuration and the props filter

 

$.response.data.<prop>

where <prop> is technical property (starting with $)

TECH

Miscellaneous

(see below)

Technical property

Depends of specific parameters and the techprops filter

 

$.response.data.$custom

TECH

Object

Custom data section

This section will be produced by a specific extension to the environment

 

$.response.data.$custom.[*]

any

Miscellaneous

Custom data properties

If a custom data section has been implemented on the environment.

 

The property type classifies properties into 6 types:

  • DATA: the data properties of the resource, such as its name, its metadata...

  • TECH: related technical properties, such as the URL of the preview, or the description of the workflow

  • STRUCT: structural data of the JSON response, such as the hateoas link section, the header description

  • META: metadata about the type of resource, such as its name or description

  • AGPG: aggregate or pagination metadata (counters, page numbers, etc), HATEOAS, etc

  • OTHERS: other

Resource data properties

This is the data of the resource (id, name, metadata, etc).

The type of the value depends on the type of the stored data:

  • string, number, boolean: the type of the stored data is one of these primitive types, or is automatically converted

  • object: properties of type unique link to another resource are represented as a JSON object
    The structure of this object is recursively the same as that of $response.data, but for the linked object.

  • array: properties of type multiple link to another resource are represented as an array of JSON objects
    The structure of these objects follows the same definition as the object type above, for each linked resource.

Resource technical properties

This is related or ancillary information to the resource, which is not stored in the resource.

See https://crossmedia.atlassian.net/wiki/spaces/WD/pages/2210889733 for more details on these properties.