D4Science D4Science Don't have a D4Science account? Create one Could not find what you are looking for? Contact us.

Profile APIs Resource

A profile defines a type and the schema any item of such a type must comply with.

GET /profiles

Returns the list of profiles name available for the context of the request (i.e. the context where the token has been generated).

Request Parameters
name type description default constraints
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources    
count query (Default:false) If count=true the API returns total number of profile instead of the list. false boolean
Response Body
media type data type description
application/json string a JSON Array.

Example

Request
GET /profiles
Content-Type: */*
Accept: application/json
Authorization: ...

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
["EmptyProfile","TestProfile","ComplexProfile"]
                
              

DELETE /profiles/{PROFILE_NAME}

Request Parameters
name type description
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
PROFILE_NAME path
Response Body
media type data type description
*/* object

Example

Request
DELETE /profiles/{PROFILE_NAME}
Content-Type: */*
Accept: */*
Authorization: ...

                
...
                
              
Response
HTTP/1.1 204 No Content
Content-Type: */*

                
...
                
              

GET /profiles/{PROFILE_NAME}

This API allow to read a profile definition.
This API return by default the content in XML.

It is possible reading a profile in JSON by specifing the HTTP Header:
Accept: application/json

Request Parameters
name type description
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
PROFILE_NAME path the name of the profile
Response Codes
code condition
200 The profile exists.
Response Body
media type data type description
application/json string the profile definition
application/xml string

Example

Request
GET /profiles/EmptyProfile
Content-Type: */*
Accept: application/json
Authorization: ...

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
	"metadataformat": {
		"metadatafield": {
			"note": "Test field",
			"fieldName": "test",
			"dataType": "String",
			"mandatory": false
		},
		"type": "EmptyProfile"
	}
}