-
Notifications
You must be signed in to change notification settings - Fork 12
Home
madhavipuliraju edited this page Nov 17, 2015
·
5 revisions
Welcome to the Outreach Portal API wiki !
- All API access is over HTTP and data is sent and received as JSON.
- To use the API layer, your application will make an HTTP request and parse the response.
- The response format is JSON.
- Your methods will be the standard HTTP methods like GET, PUT and POST.
- Appropriate HTTP verbs for each action are listed below:
Verb | Description |
---|---|
GET | Used for retrieving resources. |
PUT | Used for replacing resources or collections. |
POST | Used for creating resources. |
Following is the list of current REST APIs provided by outreach portal:
- /roles [GET, POST] - /roles/<int:id> [GET, PUT, DELETE] - /roles/<int:id>?fields=field1,field2 [GET] - /roles?query_param1=val1&query_param2=val2&..query_paramn=valn [GET] - /users [GET, POST] - /users/<int:id> [GET, PUT, DELETE] - /users/<int:id>?fields=field1,field2 [GET] - /users?query_param1=val1&query_param2=val2&..query_paramn=valn [GET] - /workshop_documents [GET, POST] - /workshop_documents/<int:id> [GET, PUT, DELETE] - /workshop_documents/<int:id>?fields=field1,field2 [GET] - /workshop_documents?query_param1=val1&query_param2=val2&..query_paramn=valn [GET]
- Parameters
Name | Description |
---|---|
id | Indicates the unique id of the role. Example Value: 2 |
name | Specifies the name of role. Example Value: Admin |
-
GET
- Example Request
/roles
- Example Result
[{"id": 1, "name": "admin"}, {"id": 2, "name": "OC"}, {"id": 3, "name": "NC"}]
- Example Request
-
POST
- Example Request
json = { "name" : "Admin" }
- Example Result
{ "id": 1, "name": "Admin" }
- Example Request
- Parameters
Name | Description |
---|---|
id | Indicates the unique id of the role. Example Value: 2 |
name | Specifies the name of role. Example Value: Admin |
-
GET
- Example Request
/roles/1
- Example Result
{ "id": 1, "name": "Admin" }
- Example Request
-
PUT
- Example Request
name = {"name":"Outreach Coordinator"}
- Example Result
{ "id": 1, "name": "Outreach Coordinator" }
- Example Request
-
DELETE
- Example Result
{ "id": "4", "status": "success" }
- Example Result
- Parameters
Name | Description |
---|---|
name | Returns the name of the role |
id | Indicates a unique id assigned to the role |
-
GET -
- Example Request
/roles/2?fields=name,id
- Example Result
{ "id": 2, "name": "OC" }
- Example Request
- Parameters
Name | Description |
---|---|
name | Returns the name of the role |
id | Indicates a unique id assigned to the role |
-
GET
- Example Request
/roles?name=OC
- Example Result
[{"id": 2, "name": "OC"}]
- Example Request
- Parameters
Name | Description |
---|---|
id | Indicates the unique id of the user. Example Value: 2 |
name | Specifies the name of user. Example Value: John |
Specifies the email of user. Example Value: John@gmail.com | |
role | Indicates the role of the user. Example Value: Admin, OC, NC |
-
GET
- Example Request
/users
- Example Result
[{"name": "John", "last_active": "2015-11-17T09:31:29", "created": "2015-11-17T09:31:29", "email": "john@gmil.com", "role": {"id": 1, "name": "Admin"}, "id": 1}]
- Example Request
-
POST
- Example Request
json = { "name" : "John", "email" : "john@gmail.com", "role" : { "id" : 1 } }
- Example Result
{ "created": "2015-11-17T09:31:29", "email": "john@gmil.com", "id": 1, "last_active": "2015-11-17T09:31:29", "name": "John", "role": { "id": 1, "name": "Admin" } }
- Example Request
- Parameters
Name | Description |
---|---|
id | Indicates the unique id of the user. Example Value: 2 |
name | Specifies the name of user. Example Value: John |
Specifies the email of user. Example Value: John@gmail.com | |
role | Indicates the role of the user. Example Value: Admin, OC, NC |
-
GET
- Example Request
/users/1
- Example Result
{ "created": "2015-11-17T09:31:29", "email": "john@gmil.com", "id": 1, "last_active": "2015-11-17T09:31:29", "name": "John", "role": { "id": 1, "name": "Admin" } }
- Example Request
-
PUT
- Example Request
name = {"name":"jane"}
- Example Result
{ "created": "2015-11-17T09:31:29", "email": "john@gmil.com", "id": 1, "last_active": "2015-11-17T09:31:29", "name": "Jane", "role": { "id": 1, "name": "Admin" } }
- Example Request
-
DELETE
- Example Result
{ "id": "1", "status": "success" }
- Example Result
- Parameters
Name | Description |
---|---|
id | Indicates the unique id of the user. Example Value: 2 |
name | Specifies the name of user. Example Value: John |
Specifies the email of user. Example Value: John@gmail.com | |
role | Indicates the role of the user. Example Value: Admin, OC, NC |
-
GET
- Example Request
/users/4?fields=name,email
- Example Result
{ "created": "2015-11-17T09:41:20", "email": "john@gmail.com", "id": 4, "last_active": "2015-11-17T09:41:20", "name": "John", "role": { "id": 1, "name": "Admin" } }
- Example Request
- Parameters
Name | Description |
---|---|
id | Indicates the unique id of the user. Example Value: 2 |
name | Specifies the name of user. Example Value: John |
Specifies the email of user. Example Value: John@gmail.com | |
role | Indicates the role of the user. Example Value: Admin, OC, NC |
-
GET -
- Example Request
/users?name=John&email=john@gmail.com
- Example Result
[{"name": "John", "last_active": "2015-11-17T09:41:20", "created": "2015-11-17T09:41:20", "email": "john@gmail.com", "role": {"id": 1, "name": "Admin"}, "id": 1}]
- Example Request
- Parameters
Name | Description |
---|---|
id | Indicates the unique id of the workshop_document. Example Value: 2 |
name | Specifies the name of workshop_document. Example Value: Attendance Sheet, Feedback Form, College Report |
path | Specifies the path of workshop_document. Example Value: /outreach-portal/workshop-docs/admin |
-
GET
- Example Request
/workshop_documents
- Example Result
[{"path": "/outreach-portal/workshop-docs/admin", "id": 1, "name": "Attendance Sheet"}, {"path": "/outreach-portal/workshop-docs/admin", "id": 2, "name": "Feedback Form"}, {"path": "/outreach-portal/workshop-docs/admin", "id": 3, "name": "College Report"}]
- Example Request
-
POST
- Example Request
json = { "name" : "Attendance Sheet", "path" : "/outreach-portal/workshop-docs/admin" }
- Example Result
{ "id": 1, "name": "Attendance Sheet", "path": "/outreach-portal/workshop-docs/admin" }
- Example Request
- Parameters
Name | Description |
---|---|
id | Indicates the unique id of the workshop_document. Example Value: 2 |
name | Specifies the name of workshop_document. Example Value: Attendance Sheet, Feedback Form, College Report |
path | Specifies the path of workshop_document. Example Value: /outreach-portal/workshop-docs/admin |
-
GET
- Example Request
/workshop_documents/1
- Example Result
{ "id": 1, "name": "Attendance Sheet", "path": "/outreach-portal/workshop-docs/admin" }
- Example Request
-
PUT
- Example Request
name = {"name":"Feedback Form"}
- Example Result
{ "id": 1, "name": "Feedback Form", "path": "/outreach-portal/workshop-docs/admin" }
- Example Request
-
DELETE
- Example Result
{ "id": "1", "status": "success" }
- Example Result
- Parameters
Name | Description |
---|---|
id | Indicates the unique id of the workshop_document. Example Value: 2 |
name | Specifies the name of workshop_document. Example Value: Attendance Sheet, Feedback Form, College Report |
path | Specifies the path of workshop_document. Example Value: /outreach-portal/workshop-docs/admin |
-
GET
- Example Request
/workshop_documents/2?fields=name,path
- Example Result
{ "id": 2, "name": "Feedback Form", "path": "/outreach-portal/workshop-docs/admin" }
- Example Request
- Parameters
Name | Description |
---|---|
id | Indicates the unique id of the workshop_document. Example Value: 2 |
name | Specifies the name of workshop_document. Example Value: Attendance Sheet, Feedback Form, College Report |
path | Specifies the path of workshop_document. Example Value: /outreach-portal/workshop-docs/admin |
-
GET
- Example Request
/workshop_documents?name=Attendance Sheet
- Example Result
[{"path": "/outreach-portal/workshop-docs/admin", "id": 1, "name": "Attendance Sheet"}]
- Example Request