To use or connect to the CRM-Map API you will first need to create a API Key to attach to all your API requests.
- API Keys have the same access as an Administrator level user. Be careful who you give them to. They can be revoked at any time.
- To use the CRM-Map’s API, some general API knowledge and skills is assumed.
- The API typically uses simple HTTP POST/GET/DELETE calls, passing the data in a JSON Format
Creating New API Keys
To create a new API Key, you will need to
- Go to maps.crm-map.com
- Sign in to your map with the owners access
- In side bar, Select Map Settings then API and Embedding
- Select Create New API Key
A new API Key will be created and added to the list of your API Keys.
Using API Keys
To use the key it can be
- Added to the HTTP request URL
http://maps.crm-map.com/api.php/products?apikey=yourapikeyhere
- Added to the HTTP Header
Content-Type: application/json;
apikey: yourapikeyhere - Added to the JSON Data in the request body
POST http://maps.crm-map.com/api.php/status
{
“apikey”:“yourapikeyhere”,
“text”:“New Status Text”,
“color”:“#FF0000”
}
API URLs and functions
This a brief out line of the function avaible in the CRM-Map API. If there are any features your implementation needs or you would like more information please Contact Us.
The API is an evolving part of CRM-Map, we will try to keep everyone updated on any breaking changes before they go live.
Items (formaly Products)
http://maps.crm-map.com/api.php/products(verb)
Method | Verb | Function |
GET | / | List all products |
GET | /:code | get a single product |
POST | / | create a single product |
POST | /:code | save a single product |
DELETE | /:code | delete a single product |
GET | /category/:code | List all products for a category |
Examples
List all products, Example URL: http://maps.crm-map.com/api.php/products/?apikey=yourapikeyhere
Product Code is currently repeated twice in the data format, this is likely to change in newer versions
{ "draw": 1, "recordsTotal": 3, "recordsFiltered": 3, "data": [ [ "Product Code", "Category", "Product Code", "Name", "" ], [ "nexus7", "Google Devices", "nexus7", "Nexus 7", "" ], [ "s6", "Samsung Devices", "s6", "Samsung Galaxy S6", ""] ], "info": [] }
Get, Create,Update a single product, Example URL: http://maps.crm-map.com/api.php/products/s6?apikey=yourapikeyhere
{ "code": "s6", "category": "Samsung Devices", "name": "Samsung Galaxy S6", "description": "A phone from samsung, made in is galaxy", "value": 299.99, "CustomFields": { "released": "2015" } }
Contacts
http://maps.crm-map.com/api.php/contacts(verb)
Method | Verb | |
GET | / | List all Contacts |
GET | /location/:locationid | List all contacts at a location |
GET | /:contactcode | get a single contacts |
POST | / | create a single contacts |
POST | /:contactcode | save a single contacts |
DELETE | /:contactcode | delete a single contacts |
Example
List all Contacts, Example GET URL: http://maps.crm-map.com/api.php/contacts?apikey=yourapikeyhere
Contact Code is currently repeated twice in the data format, this is likely to change in newer versions
{ "draw": 1, "recordsTotal": 172, "recordsFiltered": 172, "data": [ ["Contact Code","Contact Code", "Contact Name", "Suburb","" ], ["10","10", "Willunga General Store", "Willunga", ""] ], "info": [] }
Get a single contact, Example GET URL: http://maps.crm-map.com/api.php/contacts/1?apikey=yourapikeyhere
{ "contactcode": "1", "name": "Accede", "address": "23 North Tec Hacknet South Australia", "locationid": 643, "CustomFields": { "telephone": "1234 3455", "last-contacted": "", "next-visit": "", "comments": "" } }
Update or Create a single contact, Example POST URL: http://maps.crm-map.com/api.php/contacts/1?apikey=yourapikeyhere
Only an address or locationid field needs to be used. If the address field is used, a new location will be created.
The new location id will be returned in the POST result.
Custom Fields can be omitted if they not used.
All fields are optional except for Contact Code and Name.
{ "contactcode": "1", "name": "Accede", "address": "23 North Tec Hacknet South Australi Australia", "locationid": 643, "CustomFields": { "telephone": "555 5 5123", "last-contacted": "", "next-visit": "", "comments": "" } }
Transactions
http://maps.crm-map.com/api.php/transactions(verb)
Method | Verb | Function |
GET | / | List all transactions |
GET | /:code | get a single transaction |
POST | / | create a single transaction |
POST | /:code | save a single transaction |
DELETE | /:code | delete a single transaction |
GET | /products/:code | List all transactions for a product |
GET | /contacts/:code | List all transactions for a contact |
Create a single transaction, Example POST URL: http://maps.crm-map.com/api.php/transactions?apikey=yourapikeyhere
Only an Address, LocationId, or ContactId is required. CRM-Map will get the address of which every field is provided.
To remove a product from a transaction, with out deleting and recreating the transaction, set the products qty to 0 (Zero)
{ "Statusid": "1", "Products": { "1234": "1", "ProductCode": "qty" }, "address": "23 North Tec\nHacknet\nSouth Australia 5000\nAustralia", "locationid": 643, "contactid": 444, "CustomFields": {} }
Category
http://maps.crm-map.com/api.php/category/(verb)
Method | Verb | Function |
GET | / | List all categories |
GET | /:name | gets a single category |
POST | / | creates a single category |
POST | /:name | saves a single category |
DELETE | /:name | deletes a single category |
Status
http://maps.crm-map.com/api.php/status/(verb)
Method | Verb | Function |
GET | / | List all status |
GET | /:statusid | gets a single status |
POST | / | creates a single status |
POST | /:statusid | saves a single status |
DELETE | /:statusid | deletes a single status |