Page tree
Skip to end of metadata
Go to start of metadata

Getting Started

SalesSeek REST API is the straight way to interact with your SalesSeek Client. Focused on basic calls, this API provides 100% of SalesSeek functionality; every single action on the original system uses the API.

Structure of the REST URIs

SalesSeek's REST APIs provide access to resources (data entities) via URI paths.

To use a our REST API, your application will make an HTTPS request and parse the response.

The SalesSeek REST API uses JSON as its communication format and the standard HTTPS methods like   GET ,    post , patch   and    delete  (see API descriptions below for which methods are available for each resource).

URIs for SalesSeek's REST API resource have the following structure:

  https://{yourclient}.salesseek.net/api/{resource}?{key1*}={value1*}&{key2*}={value2*} yourclient - Specific SalesSeek Client Name

resource - Specific resource type (Resource) to be requested, tipically a model

key1 - Parameter identifier matching one resource's parameter (depending on the resource might be optional)

value1 - Value asociated to key1

key2 - Parameter identifier matching one resource's parameter (depending on the resource might be optional)

value2 - Value asociated to key2 https://aptui.salesseek.net/api/individuals?start=0&rows=20&order_by=modified%20desc  

Authentication

The authentication method is based on cookies encrypted by the server in the HTTPS Response after login. After getting the cookie it can be used in the next requests to the API. 

For this reason the first step should be Login and then any sequence of requests to the API.

For more details visit the Resource - Authentication

Logout action is a call to the API

Login Example - Getting the authentication cookies
import urllib.request
import urllib.parse
import json
import random
email = 'user@aptui.com'
password = 'mypassword'
client = 'aptui'
url = 'https://aptui.salesseek.net/api'
# Login
DATA = bytes(urllib.parse.urlencode({
    'email_address': email,
    'password': password
}), 'utf-8')
req = urllib.request.Request(
    '{:s}/login'.format(url),
    method='POST',
    data=DATA
)
req.add_header('ClientId', client)
res = urllib.request.urlopen(req)
cookies = res.getheader('Set-cookie')
# Response 200: Login correct

# Any request can be done adding the Cookies
# Fetch source list
req = urllib.request.Request(
    '{:s}/lead_sources'.format(url),
    method='GET'
)
req.add_header('ClientId', client)
req.add_header('Cookie', cookies)
res = urllib.request.urlopen(req)
# get Web lead source id
lead_source_id = next(x['id'] for x in json.loads(res.read().decode('utf-8')) if x['name'] == 'Web')
print('sources fetched')

 
# logout
req = urllib.request.Request(
    '{:s}/logout'.format(url),
    method='DELETE'
)
req.add_header('ClientId', client)
req.add_header('Cookie', cookies)
urllib.request.urlopen(req)
print('logged out')

 

Return

The response body is a JSON object:

  https://aptui.https//aptui.salesseek.net/api/organizations/1cf9914bef0b  

 

JSON Response
{
    abbreviation: "QNT"
    comments: ""
    communication: []
    custom_fields: {}
    id: "1cf9914bef0b"
    locations: []
    name: "Quinten"
    owner: {
        name:Jack Miller,
        id:bc299981c9e3
    }
    permissions:[
        0: "salesseek.core.view"
        1: "salesseek.core.all_permissions"
        2: "salesseek.core.edit"
    ]
    short_id: "ef0b"
}

Methods

 

Every resource from the system allows one or more of the generic methods, based on the given parameters can affect on the associated action:

  GET

Listing / Get 1 single element

In general terms is for getting elements, if the id is passed as a Request Path will respond with the specific element matching that ID, otherwise will return the entire list of elements.

 

  post

Insert

New element creation, based on the information provided in the Request Body.

 

  patch

Update

Update of a existing element, the element id has to be provided and a subset of the fields to be updated.

 

  delete

Batch / 1 single element

Deletion of elements, if the id is passed as a Request Path will delete the specific element matching that ID, for batch deletion the list of ids should be provided on the request body.

Parameters

SalesSeek API accepts different kind of parameters, each resource method description specify which are the optional and required parameters. Depending on their purpose these can be:

 

Request Path 

 

Input: Part of the URL, allows end point identification

Parameters {your_client} , {resource} and {resource_id} https://{your_client}.salesseek.net/api/{resource}/{resource_id}?{key1}={value1}&{key2}={value2}  

 

Request Path Argument

 

Input: Parameters passed as arguments of the request (after the "?") can be concatenated with &

 Parameters {key1} and {key2} with their corresponding values {value1} {value2}  

https://{your_client}.salesseek.net/api/{resource}/{resource_id}?{key1}={value1}&{key2}={value2}

 

 

Request Body 

 

Input: JSON object (or Array of JSON) passed as the request body, generally for   post   and   patch

  methods 

 

Request Body
{
  first_name: "Kim",
  last_name: "Johnson"
}

 

Request Header

 

Input: JSON containing pairs of id:value to be appended to the The HTTP request header, the following are mandatory for all endpoints:

Request Header
{
	Cookie:salesseek=87ae4c96a2a31
    Content-Type: application/json
}

Exeption for Login endpoint

Whilst generally all POST requests use content type of "application/json”, the login endpoint is an exception and requires a content type of “application/x-www-form-urlencoded” for the email address and password parameters


Response Header

 

Output: for additional information, apart from the real response:

Response-Header
{
  total_rows: 300,
  rows_per_page: 20,
  start: 61
}

 

Response Body

 

Output: The HTTP response, may be a JSON or an Array (JSON):

Response-Body
{
	communication:{
		comments: "From Mon to Sat",
		id: "2f103f9f-8e0e-41c1-aa2d-47a4a32a536a",
		medium: "email",
		name: "Work",
		value: "minion@gmail.com",
	}
	note: "emailed"
}

Resources

A resource is equivalent to an endpoint, it represents a unique class from the system. 

The resource is specified as the last endpoint on a request: after /api  

After the resource an ID may be added. The following example shows the resource organizations and the specific organizationID to be obtained by the   GET   method in this case is the 1cf9914bef0b

  https://{client_id}.salesseek.net/api/organizations/1cf9914bef0b?extra_fields=owner  

Depending on its definition an resource may respond to one the generic request methods.

For the specific method details per resource click on:

Activity

Authentication

Automations

Buckets

Client

Content

Credit Card Billing

Custom Fields

Forecasts

Groups

Individuals

Leads

Lead Source

Mailshots

Opportunities

Organizations

Permission Defaults

Phases

Reporting Periods

Revenue Planner Configuration

SmartGroups

Social

Social Account

Teams

Team Hierarchy

Users

Web Form Matching

Web Tracking

 

 


 

 

 

 

 

  • No labels