-
Notifications
You must be signed in to change notification settings - Fork 1
Search documentation
Steven Myers edited this page Feb 28, 2016
·
6 revisions
The /search
path accepts a query string with a name
or id
parameter and will return all the immediate links related to that person. That is: the person's supervisor, mentor, who they supervised and who they mentored. The people
array and institution
array normalize the data to avoid duplications.
curl -X GET "localhost:3000/search?name=todd%20lowary"
{
"mentors":[
{
"id":1,
"mentor_name":"david bundle",
"person_id":1,
"postdoc_id":1,
"mentor_id":4,
"approved":true
},
{
"id":2,
"mentor_name":"morten meldel",
"person_id":1,
"postdoc_id":2,
"mentor_id":null,
"approved":true
}
],
"mentored":[
],
"supervisors":[
{
"id":1,
"supervisor_name":"ole hindsgaul",
"approved":true,
"degree_id":1,
"person_id":1,
"supervisor_id":3
}
],
"supervised":[
{
"id":2,
"supervisor_name":"todd lowary",
"approved":true,
"degree_id":2,
"person_id":2,
"supervisor_id":1
}
],
"people":[
{
"id":1,
"name":"todd lowary",
"position":"professor",
"approved":true,
"institution_id":1
},
{
"id":2,
"name":"wei shi",
"position":"assistant professor",
"approved":true,
"institution_id":3
},
{
"id":3,
"name":"ole hindsgaul",
"position":"professor emeritus",
"approved":true,
"institution_id":1
},
{
"id":4,
"name":"david bundle",
"position":"professor emeritus",
"approved":true,
"institution_id":1
}
],
"institutions":[
{
"id":1,
"name":"university of alberta",
"approved":true
},
{
"id":3,
"name":"university of arkansas",
"approved":true
}
]
}
notice: the %20
code in place of the space character.
using curl -X GET "localhost:3000/search?id=1"
will attain the same result.