-
Notifications
You must be signed in to change notification settings - Fork 3
The Web API is a new REST based interface to key parts of the TeamHaven Server business layer. It is available under the /api URL of TeamHaven servers. Eg:
http://www.teamhaven.com/api
http://dev.teamhaven.com/api
http://beta.teamhaven.com/api
Eventually it will be available via HTTPS as well, but currently it is not.
Authorisation is performed via HTTP Basic authorisation, using Base64 encoded TeamHaven credentials. It is also possible to provide unencoded credentials using "TeamHaven" as the authentication scheme name rather than "Basic".
Authorization: Basic c3RvbnkvdGVzdDp0ZXJyaWVy
or
Authorization: TeamHaven username/account:password
A standard TeamHaven authentication cookie can also be used, so that if web pages on the TeamHaven website wish to use the WebAPI, they may do so without having to take any action, as their requests will already contain the required cookie. This means you can log into TeamHaven and review the output of any GET requests via your web browser, provided it can display XML or JSON output.
- 2xx
- Success
- 4xx
-
Something was wrong with your request. Check the
Messageproperty of the response for more information about what was wrong. - 5xx
- An exception prevented the server from processing your request, contact support@teamhaven.com for assistance.
GET /api/user
Gets information about the logged in user.
GET /api/users/schema
Gets the user schema.
GET /api/log
List all login sessions matching the specified criteria
- severity
- Return only login sessions with an error at least a severe as level N. The lower the severity number, the worse the issue. Levels 0-3 are actual errors, Levels 4-7 are warnings and debug messages.
- user
- Only return sessions associated with the specified User ID.
GET /api/log/:ticket
List individual log entries for the given login session.
The Audit Log tracks actions that have affected certain TeamHaven objects, providing an audit trail of who has modified them.
GET /api/audit/:type/:id
List actions that modified the specified object.
- type
-
callfor the call audit log - id
- The TeamHaven ID of the object being audited. Ie, a Call ID when type=
call
Checkins allow a user to send status updates about a specific call to the server without having to complete the call itself.
POST /api/user/calls/:id/checkins
Send a status update.
- id
- The Call ID that the user is sending a status update for
{
Type: 1,
Date: '2013-02-01T14:49:40.223',
LatLng: { Lat = 52.5, Lng = 0.2 },
Message: 'Arrived at store'
}- Type
-
The type of checkin being posted:
-
1Arrival -
2Departure -
3Status update
-
- Date
- Optional UTC date and time of the checkin.
- LatLng
- An optional object giving the latitude and longitude of the user's current position.
- Message
- An optional message
GET /api/calls/:id/checkins
List the checkins posted for specific call.
GET /api/localisation/text/:culture/:path
Lists the localised text for a set of labels.
- culture
- An ISO 639-2 language code, eg
enfor English, orfrfor French .
- path
- Further parts of the path allow a subset of labels to be returned, eg
/api/localisation/text/en/CallStatuswill return the English translations of all labels beginning with/CallStatus.
- platform
-
An optional platform identifier that filters the results to just those flagged as required by the given platform:
-
pocketpcWindows Mobile -
androidAndroid -
windows8Windows RT and Windows 8
-