REST interface for the social networking library (users).
Get the map of couples username/fullname of the users belonging to a given context
| name | type | description |
|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources |
| Content-Type | header | application/json |
| code | condition |
|---|---|
| 200 | The map is put into the 'result' field of the returned object |
| 500 | The error is reported into the 'message' field of the returned object |
| media type | data type | description |
|---|---|---|
| application/json | object (JSON) | the map of couples username/fullname of the users belonging to the context linked to the provided token. |
GET /2/users/get-all-fullnames-and-usernames
Content-Type: */*
Accept: application/json
Authorization: ...
...
HTTP/1.1 200 OK
Content-Type: application/json
...
| name | type | description |
|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources |
| Content-Type | header | application/json |
| code | condition |
|---|---|
| 200 | The list of usernames is put into the 'result' field of the returned object |
| 500 | The error is reported into the 'message' field of the returned object |
| media type | data type | description |
|---|---|---|
| application/json | object (JSON) | the list of usernames for the user belonging to the context linked to the provided auth token |
GET /2/users/get-all-usernames
Content-Type: */*
Accept: application/json
Authorization: ...
...
HTTP/1.1 200 OK
Content-Type: application/json
{
"success" : true,
"message" : null,
"result" : [ "john.smith", "marco.polo" ]
}
Read a user's custom attribute. The user is the one owning the token
| name | type | description | constraints |
|---|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources | |
| Content-Type | header | application/json | |
| attribute | query | The key of the attribute to be read | required |
| code | condition |
|---|---|
| 200 | Successful read of the attribute, reported in the 'result' field of the returned object |
| 404 | Such an attribute doesn't exist |
| 500 | The error is reported into the 'message' field of the returned object |
| media type | data type | description |
|---|---|---|
| application/json | object (JSON) | the user's custom attribute |
GET /2/users/get-custom-attribute
Content-Type: */*
Accept: application/json
Authorization: ...
...
HTTP/1.1 200 OK
Content-Type: application/json
...
Read the user's email address. The user is the one owning the token
| name | type | description |
|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources |
| Content-Type | header | application/json |
| code | condition |
|---|---|
| 200 | The user's email is reported in the 'result' field of the returned object |
| 500 | The error is reported into the 'message' field of the returned object |
| media type | data type | description |
|---|---|---|
| application/json | object (JSON) | rhe user's email address |
GET /2/users/get-email
Content-Type: */*
Accept: application/json
Authorization: ...
...
HTTP/1.1 200 OK
Content-Type: application/json
...
Read the user's fullname. The user is the one owning the token
| name | type | description |
|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources |
| Content-Type | header | application/json |
| code | condition |
|---|---|
| 200 | The user's fullname is reported in the 'result' field of the returned object |
| 500 | The error is reported into the 'message' field of the returned object |
| media type | data type | description |
|---|---|---|
| application/json | object (JSON) | the user's fullname |
GET /2/users/get-fullname
Content-Type: */*
Accept: application/json
Authorization: ...
...
HTTP/1.1 200 OK
Content-Type: application/json
...
| name | type | description |
|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources |
| Content-Type | header | application/json |
| media type | data type | description |
|---|---|---|
| application/json | object (JSON) | the user's profile compliant with oauth |
GET /2/users/get-oauth-profile
Content-Type: */*
Accept: application/json
Authorization: ...
...
HTTP/1.1 200 OK
Content-Type: application/json
{
"id" : "john.smith",
"roles" : [ ],
"picture" : "https://***gAJ4uVWTA74xwQ6%2FCA72RRinysY%3D",
"name" : "John Smith",
"middle_name" : "",
"male" : true,
"location_industry" : "no",
"given_name" : "John",
"email" : "******",
"job_title" : "",
"family_name" : "Smith",
"verified_email" : true
}
Get the profile associated to the token
| name | type | description |
|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources |
| Content-Type | header | application/json |
| code | condition |
|---|---|
| 200 | The user's profile is reported in the 'result' field of the returned object |
| 500 | The error is reported into the 'message' field of the returned object |
| media type | data type | description |
|---|---|---|
| application/json | object (JSON) | the user's profile. The user is the one owning the token |
GET /2/users/get-profile
Content-Type: */*
Accept: application/json
Authorization: ...
...
HTTP/1.1 200 OK
Content-Type: application/json
{
"success" : true,
"message" : null,
"result" : {
"user_id" : 23769487,
"username" : "john.smith",
"email" : "********",
"first_name" : "John",
"middle_name" : "",
"last_name" : "Smith",
"fullname" : "John Smith",
"registration_date" : 1475151491415,
"user_avatar_url" : "https://******D",
"male" : true,
"job_title" : "",
"location_industry" : "no",
"custom_attrs_map" : null,
"email_addresses" : [ ],
"screen_name" : "john.smith",
"user_avatar_id" : "https://****sY%3D"
}
}
Get the list of users having a given global-role, e.g. 'Administrator'. (Legacy)
| name | type | description |
|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources |
| Content-Type | header | application/json |
| role-name | query | the name of the role to be checked (e.g. Administrator) |
| code | condition |
|---|---|
| 200 | The list is put into the 'result' field of the returned object |
| 500 | The error is reported into the 'message' field of the returned object |
| media type | data type | description |
|---|---|---|
| application/json | object (JSON) | the list of users having a given global-role |
GET /2/users/get-usernames-by-global-role
Content-Type: */*
Accept: application/json
Authorization: ...
...
HTTP/1.1 200 OK
Content-Type: application/json
...
| name | type | description |
|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources |
| Content-Type | header | application/json |
| role-name | query | the role name |
| media type | data type | description |
|---|---|---|
| application/json | object (JSON) | the usernames having the role in the VRE |
GET /get-usernames-by-role?role-name=VRE-Manager
Content-Type: */*
Accept: application/json
Authorization: ...
...
HTTP/1.1 200 OK
Content-Type: application/json
{
"success" : true,
"message" : null,
"result" : [ "john.smith", "marco.polo" ]
}
| name | type | description |
|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources |
| Content-Type | header | application/json |
| username | query |
| media type | data type | description |
|---|---|---|
| application/json | object (JSON) |
GET /2/users/user-exists
Content-Type: */*
Accept: application/json
Authorization: ...
...
HTTP/1.1 200 OK
Content-Type: application/json
...