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

User APIs Resource

This collection allows to interact with the catalogue users. Only Catalogue-Admins or above are able to invoke non-safe methods.

DELETE /users

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

Example

Request
DELETE /users
Content-Type: */*
Accept: */*
Authorization: ...

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

                
...
                
              

GET /users

Request Parameters
name type description
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
Response Body
media type data type description
application/json;charset=UTF-8 string

Example

Request
GET /users
Content-Type: */*
Accept: application/json;charset=UTF-8
Authorization: ...

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8

                
[
	{
        "openid": null,
        "about": "",
        "display_name": "Blue Mister",
        "name": "mister_blue",
        "created": "2022-04-08T14:31:03.978191",
        "email_hash": "XXXXXXX",
        "sysadmin": false,
        "activity_streams_email_notifications": false,
        "state": "active",
        "number_of_edits": 28,
        "fullname": "Blue Mister",
        "id": "c9f7a81d-75f6-4cf8-aab9-b4c90dce9405",
        "number_created_packages": 0
    },
    {
        "openid": null,
        "about": "",
        "display_name": "Brown Mister",
        "name": "mister_brown",
        "created": "2022-04-12T17:06:51.075728",
        "email_hash": "XXXXXXX",
        "sysadmin": false,
        "activity_streams_email_notifications": false,
        "state": "active",
        "number_of_edits": 0,
        "fullname": "Brown Mister",
        "id": "7445ef41-08d8-4559-8750-3232eb0e1914",
        "number_created_packages": 0
    }
]
                
              

POST /users

A User is mainly described by the following attributes (* indicate mandatory attributes):

name* (string)
the name of the user, a string between 2 and 100 characters long, containing only lowercase alphanumeric characters, '-' and '_' ;
id (string)
the id of the user;
fullname (string)
the fullname of the user;
email (string)
the email address for the user;
password (string)
the password of the user, a string of at least 4 characters (parameter only used internally to create a new user in Ckan);
about (string)
a description of the user.

Request Parameters
name type description
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
Request Body
media type data type
application/json;charset=UTF-8 string
Response Body
media type data type description
application/json;charset=UTF-8 object

Example

Request
POST /users
Content-Type: application/json;charset=UTF-8
Accept: application/json;charset=UTF-8
Authorization: ...

                
...
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json;charset=UTF-8

                
...
                
              

DELETE /users/{GCUBE_USERNAME}

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

Example

Request
DELETE /users/{GCUBE_USERNAME}
Content-Type: */*
Accept: */*
Authorization: ...

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

                
...
                
              

GET /users/{USER_ID}

Read the profile of the user in Ckan The apikey to interact directly with Ckan are returned only for Catalogue-Managers and only for its own profile. The service add the user's role in portal_role property when the user read its own profile. See Roles section for more information.

Request Parameters
name type description
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
USER_ID path Ckan or gCube username are both accepted
Response Body
media type data type description
application/json;charset=UTF-8 string

Example

Request
GET /users/luca.frosini
Content-Type: */*
Accept: application/json;charset=UTF-8
Authorization: ...

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8

                
{
	"openid": null,
	"about": "",
	"apikey": "XXXXXXX",
	"display_name": "Frosini Luca",
	"name": "luca_frosini",
	"created": "2016-12-09T15:18:21.915742",
	"email_hash": "XXXXXXX",
	"email": "XXXXXXX@XXXXXXX",
	"sysadmin": false,
	"activity_streams_email_notifications": false,
	"state": "active",
	"number_of_edits": 1622,
	"fullname": "Frosini Luca",
	"id": "aabddbb0-b761-4f30-9629-3ca2fdc08eb4",
	"number_created_packages": 4
}
                
              

PURGE /users/{USER_ID}

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

Example

Request
PURGE /users/{USER_ID}
Content-Type: */*
Accept: */*
Authorization: ...

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: */*

                
...
                
              

PUT /users/{USER_ID}

Request Parameters
name type description
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
USER_ID path
Request Body
media type data type
application/json;charset=UTF-8 string
Response Body
media type data type description
application/json;charset=UTF-8 string

Example

Request
PUT /users/{USER_ID}
Content-Type: application/json;charset=UTF-8
Accept: application/json;charset=UTF-8
Authorization: ...

                
...
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json;charset=UTF-8

                
...