API Documentation for Case Camp
Request Structure
All API calls are standard HTTP requests (GET,PUT,POST,DELETE).
We have production and staging environments, testing will go through staging and live app will go through production.
Staging URL : https://crm.moblearn.net
Production URL: http://casecamp.com/
For security purposes, we require all API calls to contain an authentication token (except login) This authentication token must be included as an additional parameters.
access_token will be provided when login api call.
Example
Consider a request to get activities
Assume the auth_token is ‘OZEGEArQoMFSpLGNlZhC’ The request we intend to send is as follows:
- Method: GET
- Endpoint: ENV(URL)/api/activity
- Parameters to be sent:
- ?: OZEGEArQoMFSpLGNlZhC
Then the request will be
https://crm.moblearn.net/api/api/activity?access_token=OZEGEArQoMFSpLGNlZhC×tamp=1377667413
Sending this request will successfully return the activities.
RestAPI calls
- Login
- Method : POST
- Request path: ENV(URL)/api/login
- Purpose: Login with username and password in crm
- Parameters:
- username – User’s email address
- password – User’s chosen password
- Status code 200
- JSON representation of a hash as follows
{“access_token => “fjasfohjiurehfklnj”}
- Status code 400 – Internal Error
- JSON representation of a hash with message.
- Account
- Method : GET
- Request path: ENV(URL)/api/account
- Purpose: Get user info
- Parameters:
- access_token – authentication token (get from login call)
- Status code 200
- JSON representation of a hash as follows
{
"data": {
"firstName": "xxxx",
"email": "xxx@auctionsoftware.com",
"lastName": "xxx",
"state": null,
"country": null
},
"success": true
}
- Status code 400 – Internal Error
- JSON representation of a hash with message.
- Info Call
- Method : GET
- Request path: ENV(URL)/api/info
- Purpose: Check access token is valid or not if not valid redirect the user to login
- Parameters:
- access_token – authentication token (get from login call)
- Status code 200
- JSON representation of a hash as follows
{
"data": {
"email": "navin@auctionsoftware.com"
},
"success": true
}
- Status code 400 – Internal Error
- JSON representation of a hash with message.
- Update user account
- Method : PATCH
- Request path: ENV(URL)/api/account
- Purpose: Update user first name, last name, state, country
- Parameters:
- access_token authentication token (get from login call)
- Email – user email
- firstName – user first name
- lastName – user last name
- Country – updated country
- State – updated state
- Status code 200
- JSON representation of a hash as success message
- Status code 400 – Internal Error
- JSON representation of a hash with message.
- Update user Password
- Method : POST
- Request path: ENV(URL)/api/password
- Purpose: Update user password
- Parameters:
- access_token authentication token (get from login call)
- old_value – users old password
- new_value – user new password
- Status code 200
- JSON representation of a hash as success message
- Status code 400 – Internal Error
- JSON representation of a hash with message.
- Get Activities
- Method : GET
- Request path: ENV(URL)/api/activity
- Purpose: Get user report activities
- Parameters:
- access_token authentication token (get from login call)
- Status code 200
- JSON representation of a hash
{
"data": [
{
"date": "2016-05-17",
"cases": 1,
"hours": 1
},
{
"date": "2016-05-12",
"cases": 2,
"hours": 3
},
{
"date": "2016-05-11",
"cases": 2,
"hours": 3
},
],
"success": true
}
- Status code 400 – Internal Error
- JSON representation of a hash with message.
- Get Status Report
- Method : GET
- Request path: ENV(URL)/api/status_report
- Purpose: Get the cases needs to report
- Parameters:
- access_token – authentication token (get from login call)
- Status code 200
- JSON representation of a hash as success message
{
"data": {
"date": "2016-05-18",
"times": [
{
"time": "5:00PM",
"projects": [
{
"code": "10050",
"title": "India Team Status Report",
"cases": [
{
"code": "10417",
"name": "xxxx"
}
]
},
]
}
]
},
"success": true
}
- Status code 400 – Internal Error
- JSON representation of a hash with message.
- Update Status Report
- Method : POST
- Request path: ENV(URL)/api/status_report
- Purpose: Update Status Report
- Parameters:
- access_token – authentication token (get from login call)
- Location (lat, long)
- Photo
- cases
- Status code 200
- JSON representation of a hash as success message
- Status code 400 – Internal Error
- JSON representation of a hash with message.
- Post IOS device token
- Method : POST
- Request path: ENV(URL)/ios_device_token
- Purpose: Post the ios push notification token
- Parameters:
- access_token – authentication token (get from login call)
- token
- Status code 200
- JSON representation of a hash as success message
- Status code 400 – Internal Error
- JSON representation of a hash with message.