Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MSU People Search API
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MSU Hackathon
MSU People Search API
Commits
d05fbcb8
Commit
d05fbcb8
authored
11 years ago
by
Troy Murray
Browse files
Options
Downloads
Patches
Plain Diff
Add department name as a search query field
parent
8324379b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MSU-People-Search-API.raml
+6
-4
6 additions, 4 deletions
MSU-People-Search-API.raml
app.js
+5
-1
5 additions, 1 deletion
app.js
with
11 additions
and
5 deletions
MSU-People-Search-API.raml
+
6
−
4
View file @
d05fbcb8
#%RAML 0.8
title: MSU People Search API
baseUri: http://hackathon-14.itservices.msu.edu/api/1
version: v1.
1
version: v1.
2
/persons:
get:
queryParameters:
msunetid:
description: Search by person MSU NetID
description: Search by person MSU NetID
, wildcard is included after string provided.
lastname:
description: Search by person last name
description: Search by person last name
, wildcard is included after string provided.
firstname:
description: Search by person first name
description: Search by person first name, wildcard is included after string provided.
departmentname:
description: Search by department name, uses wildcard before and after string provided.
description: Retrieving a record set of people that match the query parameters
/{msunet}:
get:
...
...
This diff is collapsed.
Click to expand it.
app.js
+
5
−
1
View file @
d05fbcb8
...
...
@@ -43,9 +43,13 @@ app.get('/api/1/persons', function(request, response) {
console
.
log
(
request
.
query
.
msunetid
);
opts
.
filter
+=
'
(uid=
'
+
request
.
query
.
msunetid
+
'
*)
'
;
}
if
(
request
.
query
.
departmentname
!==
undefined
){
console
.
log
(
request
.
query
.
departmentname
);
opts
.
filter
+=
'
(departmentNumber=*
'
+
request
.
query
.
departmentname
+
'
*)
'
;
}
if
(
opts
.
filter
===
'
&
'
){
response
.
json
(
500
,
{
error
:
'
Please put in a firstname, lastname, or msunetid to search
'
})
'
Please put in a firstname, lastname,
department name
or msunetid to search
'
})
}
console
.
log
(
'
Filter
'
,
opts
.
filter
);
client
.
search
(
'
dc=msu,dc=edu
'
,
opts
,
function
(
err
,
res
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment