AMPED Web Services API Documentation
Introduction
This documentation describes the REST-based application programming interface (The RESTful API) published by AMPED. It is meant as a reference document for consumers of the API. We recommend that you go through the tutorial before you attempt to read this documentation.
All structural data including response from the API is represented as JSON strings.
Each entity has a specially formatted id that can be used to look up an entity's type and the record. Create is the one case that does not require an id.
URL Format
https: //app.amped.ai/webservice.php?operation=[operation type]&sessionName=[session Name]&[operation specific parameters] |
Operations
Currently, the following operations are supported,
-
login
-
create
-
retrieve
-
update
-
associate
-
delete
-
sync
-
query
-
search (Global)
-
listtypes
-
describe
-
quickdescribe
-
getwidgets
-
getitems
-
getrelatedlists
-
logout
-
extendsession
-
getFilters
sessionName
The key is used to uniquely identify the current session. This should be sent to the server as part of each request.
Security
The web services API supports the security model followed in the AMPED web user interface.
The login process uses the OAuth token scheme. The token aka. sessionName must be present in all API requests after login. Also, the AMPED and the web service enforce the usage of HTTPS.
Data Types used by the API
The Response Format
All responses will have the following format. If the request is processed successfully, then the format is:
Response { success:Boolean= true result:Object //The Result object } |
If there is a failure while processing the request:
Response { success:Boolean= false error:ErrorObject } ErrorObject { errorCode:String //String representation of the error type errorMessage:String //Error message from the api. } |
The errorCode is a CAMEL_CASED_CAPITALIZED string representation of the error type.
AMPEDObject
A Map is representing the contents of a crmentity-based object. All reference fields are represented using Id type. A key called id of type Id represents the object's unique id. This field is present for any object fetched from the database.
Id Format
objectTypeId 'x' objectId |
objectTypeId - Id of the object type. This is generated uniquely for each entity supported by web service API and returned in the result of describing the operation as idPrefix.
objectId - the id of the object in the database. This is a globally unique id for objects of the given entity.
Map
An associative array of key-value pairs. Usually used in create operation.
TimeStamp
A long representation of the number of seconds since Unix epoch.
LoginResult
An object representing the response of a login operation:
LoginResult { sessionName:String //Unique Identifier for the session userId:String //The AMPED id for the logged in user company:String //The name of user's company modules_meta:Object //Quick create modules information for user hour_format:String //User's preferred hour format date_format:String //User's Preferred date format widgets_meta:Object //User's widget related information version:String //The version number of the webservices api vcrmversion:String //The version number of the AMPED. refreshToken: String // for rememberMe purpose } |
Note: The refreshToken is sent only if rememberMe parameter is set to 'true' in the login request.
SyncResult
An object representing the response of a sync operation:
SyncResult { updated:[Object] //List of Objects created or modified. deleted:[Id] //List of \*Id\* of objects deleted. lastModifiedTime:Timstamp //time of the latest change. which can used in the next call to the Sync api to get all the latest changes that the client hasn't obtained. } |
Operations
Login
Login to the server using the challenge token obtained in the get challenge operation:
login(username:String, accessKey:String[, rememberMe:String]): LoginResult |
Request Type: POST
username: An AMPED username.
accessKey: An md5 of the concatenation of the challenge token and the user's webservice access key.
response: A LoginResult object containing session id, user id, company name, user's preferred date, and hour format, API version id, AMPED version number, quick create modules data, and widgets data. Additionally, for remember me login AMPED customer id and a token id are included.
This must be a POST request.
URL format
https: //app.amped.ai/webservice.php?operation=login&username=[username]&accessKey=[accessKey]&rememberMe=[true or false] |
Note: In accessKey 'K' is uppercase and rememberMe is optional.
Create
Create a new entry on the server:
create(element:Map, elementType:String): AMPEDObject |
Request Type: POST
element: Fields of the object to populate. Values for mandatory fields must be provided.
elementType: The class name of the object.
This Must be a POST request.
URL format:
https: //app.amped.ai/webservice.php?operation=create&sessionName=[session id]&element=[object]&elementType=[object type] |
response: An AMPEDObject instance representing the new object.
Retrieve
Retrieve an existing entry from the server:
retrieve(id:String): AMPEDObject |
Request Type: GET
id: The AMPED Id of the object.
response: An AMPEDObject instance representing the retrieved object.
This Must be a GET request.
URL format:
https: //app.amped.ai/webservice.php?operation=retrieve&sessionName=[session id]&id=[object id] |
Update
Update an existing entry on the AMPED object.
update(object: AMPEDObject): AMPEDObject
Request Type: POST
object: The AMPEDObject to update.
response: An AMPEDObject representing the object after the update.
This Must be a POST request.
URL format:
https: //app.amped.ai/webservice.php?operation=update&sessionName=[session id]&element=[object] |
Associate
Associate one or multiple related list entry to a AMPED id:
associate(id:String, relatedType:String, elements:String): RelatedListsResult |
Request Type: POST
id: The AMPED Id of the object.
relatedType: The related type name of the AMPED object
elements: array of AMPED Id of objects of related type
Returns RelatedListsResult
This Must be a POST request.
URL format:
https: //app.amped.ai/webservice.php?operation=associate&sessionName=[session id]&id=[object id]&relatedType=[elementType]&elements=[object id array] |
Delete
Delete an entry from the server.
delete(id:String):Nothing
Request Type: POST
id: The AMPED Id of the object to be deleted.
response: A map with one key status with value 'successful'
This Must be a POST request.
URL format:
[https: //app.amped.ai/webservice.php?operation=delete&sessionName=[session id]&id=[object id] |
Query
The query operation provides a way to query AMPED for data:
query(queryString:String): AMPEDObject |
Request Type: GET
queryString: The query to process.
response: An array of AMPED objects containing the fields selected.
Queries are currently limited to a single type of object and joins are not supported between object types.
The query always limits its output to 100 records, Client application can use the limit operator to get different records.
The query format:
SELECT * | count (*)> FROM
[ WHERE
[ order by
|
The column list in the order by clause can have at most two column names.
- column list: comma separated list of field names.
- object: type name of the object.
- conditionals: condition operations or in clauses or like clauses separated by 'and' or 'or' operators these are processed from left to right. The are no grouping that is bracket operators.
- conditional operators: <, >, <=, >=, =,!=
- in clauses: IN ()
- like clauses: LIKE 'sqlregex'
- value list: a comma separated list of values.
- m, n: integer values to specify the offset and limit respectively.
This must be a GET request.
The query operation is currently supported for the Entity module only.
URL format:
https: //app.amped.ai/webservice.php?operation=query&sessionName[session id]&query=[query string] |
Search (Global Search)
Search on the predefined fields of some predefined modules in the entire AMPED.
search(key: String): SearchResult Object
Request Type: GET
key: searchValue to search against.
response: An array of AMPEDObject containing the fields selected grouped by modules
This must be a GET request.
URL format:
https: //app.amped.ai/webservice.php?operation=search&sessionName=[session id]&key=[searchValue] |
Sync
Sync will return a SyncResult object containing details of changes after modifiedTime:
sync(modifiedTime: Timestamp, elementType: String):SyncResult |
Request Type: GET
modifiedTime: The time of the last synced modification.
elementType: This is an optional parameter if specified the changes for that module after the given time otherwise changes to all user-accessible modules are returned.
Returns a SyncResult object representing the sync data.
This must be a GET request.
URL format:
https: //app.amped.ai/webservice.php?operation=sync&sessionName=[session id]&modifiedTime=[timestamp]&elementType=[elementType] |
Logout
Logout from the web service session, this leaves the web service session invalid for further use:
logout(): Map |
Request Type: GET
Returns a map containing the key 'message' with the value 'successful'.
This must be a GET request.
URL format:
https: //app.amped.ai/webservice.php?operation=logout&sessionName=[session id] |
List Types
List the names of all the AMPED objects available through the API:
listtypes(): Map |
Request Type: GET
Returns a map containing the key 'types' with the value being a list of names of AMPED objects.
This must be a GET request.
URL format:
https: //app.amped.ai/webservice.php?operation=listtypes&sessionName=[session id] |
Describe
Get the type information about a given AMPED object:
describe(elementType: String): DescribeResult |
Request Type: GET
elementType: The type name of the AMPED object to describe.
Returns a DescribeResult instance.
This must be a GET request.
URL format:
https: //app.amped.ai/webservice.php?operation=describe&sessionName=[session id]&elementType=[elementType] |
Quick Describe
Get only quick create fields and mandatory fields information about a given AMPED object:
quickdescribe(elementType: String, [id: String]]): QuickDescribeResult |
Request Type: GET
elementType: The type name of the AMPED object to describe.
id: The AMPED Id of the object. (Optional)
Returns a QuickDescribeResult instance.
This must be a GET request.
url format:
https: //app.amped.ai/webservice.php?operation=quickdescribe&sessionName=[session id]&elementType=[elementType]&id=[object id] |
Get Widgets
Get the list of widgets with details displayed at the dashboard:
getwidgets(elementType: String): WidgetsResult |
Request Type: GET
Returns WidgetsResult
This must be a GET request.
url format:
https: //app.amped.ai/webservice.php?operation=getwidgets&sessionName=[session id] |
Get Items
Get the recently accessed items (similar to recent web app view) of a given AMPED object:
getitems(elementType: String): ItemsResult |
Request Type: GET
elementType: The type name of the AMPED object.
Returns ItemsResult
This must be a GET request.
URL format:
https: //app.amped.ai/webservice.php?operation=getitems&sessionName=[session id]&elementType=[elementType] |
Get Related Lists
Get the related list items grouped by modules of a given AMPED object:
getrelatedlists(id: String): RelatedListsResult |
Request Type: GET
id: The AMPED Id of the object.
Returns RelatedListsResult
This must be a GET request.
URL format:
https: //app.amped.ai/webservice.php?operation=getrelatedlists&sessionName=[session id]&id=[object id] |
Extend Session
Extends current AMPED web-session to webservices and returns a webservices session id.
extendsession(username:String):LoginResult
Request Type: POST
username: An AMPED username.
This must be a POST request.
URL format:
https: //app.amped.ai/webservice.php?operation=extendsession |
Get Filters
Get all the filters of a given AMPED object.
getfilters(elementType: String): FiltersResult |
Request Type: GET
elementType: The type name of the AMPED object.
Returns FiltersResult
This must be a GET request.
URL format:
https: //app.amped.ai/webservice.php?operation=getfilters&sessionName=[session id]&elementType=[elementType] |
AMPED Entities
List of AMPED Entities exposed by the API.
Calendar |
The Calendar module is used to manage To Dos, Events, and Meetings. |
Leads |
The Leads module is used to track sales leads. |
Accounts |
The Accounts module is used to manage individuals or organizations involved in your business. |
Contacts |
The Contacts module is used to Manage individuals, who may be associated with an Account. |
Opportunity |
The Opportunity module is used to manage sales opportunities. |
Emails |
The Emails module is an email client used to manage your emails. |
Campaigns |
The Campaigns module is used for managing marketing campaigns. |
Events |
The Events module is used for managing activities such as Calls and Meetings. |
Users |
The Users module is used for managing the AMPED users. |
Groups |
Users groups on the AMPED. |
Delyte Entities
List of additional Delyte Entities exposed by the API.
HelpDesk |
The HelpDesk module is used to track customer issues such as feedback, problems, etc. |
Faq |
The FAQ module is used to manage the frequently asked question by your customer. |
Field Types
picklist
A field that can hold one of a list of values, the map will contain two elements,
picklistValues which is a list of possible values, and defaultValue which is the default value for the picklist.
picklistValues |
Which is a list of possible values. |
defaultValue |
specifies which value should be used as the default value for the picklist. |
name |
Name of the field type. |
reference
A field that shows a relation to another object, the field type map will contain another element called refersTo which is an array containing the name of modules of which the field can point to.
refersTo |
Which is an array containing the name of modules to which the field can point to. |
name |
Name of the field type. |
datetime
A string representing the date and time, the format is base on the user's settings date format.
date
A string representing a date, the field type map will contain another element called format which is the format in which the value of this field is expected, its based on the user's settings date format.
format |
The format in which the value of this field is expected. |
name |
Name of the field type. |
text
A multiline text field.
time
A string of the format hh:mm, format is based on the user's settings time format.
string
A one-line text field.
boolean
A boolean field can have the values true or false.
integer
A nondecimal number field.
owner
A field for defining the owner of the field. which could be a group or individual user.
autogenerated
These are fields for which the values are generated automatically by AMPED, this is usually an object's id field.
A field for storing email ids.
phone
A field for storing phone numbers.
URL
A field for storing URLs.
double
A field for floating point numbers.
file
A field for Adding files to AMPED.
maxUploadFileSize |
Max allowed size of a file getting uploaded. |
name |
Name of the field type. |
password
A field for storing passwords.
decimal
A field for floating point numbers.
skype
A field for storing skype ids or phone numbers.
multipicklist
A picklist field where multiple values can be selected.
Known Issues
- Sync does not work on the users' module And non Entity modules like Groups.
- The query does not work on non Entity modules like Groups.