Skip to main content

Solve360 API Python wrapper

Project description

Python wrapper for Norada CRM Solve360 API.

Solve360 API Documentation

http://norada.com/answers/api/external_api_introduction

Installation

$ pip install solve360

Usage

The API methods and parameters are the same for all record types, i.e. Contacts, Companies and Project Blogs. Simply use the appropriate segment name for the record type. For example, if creating a:

  • Contact - Use crm.create_contact()

  • Company - Use crm.create_company()

  • Projectblog - Use crm.create_projectblog()

Initiate solve360 object

>>> from solve360 import Solve360
>>> crm = Solve360(your_email, your_token)

List contacts

>>> crm.list_contacts()
{u'status': 'success',
 u'count': 2,
 u'12345': {...},
 u'12346': {...}}

Reference

Get contacts - paginated

The solve360 API have a fixed upper limit on objects each list request will return, currently set to 5000. To fetch more objects in a single request this wrapper offers a parameter pages. The request will continue to fetch objects until either all objects are returned or the number of given pages have been reached.

>>> contacts = crm.list_contacts(limit=solve360.LIST_MAX_LIMIT, pages=2)
>>> contacts
{u'status': 'success',
 u'count': 12000,
 u'12345': {...},
 u'12346': {...},
 ...}
>>> len(contacts)
10002  # Keys 'status' and 'count' plus 10000 contacts

Parameter pages must be a positive number. There is currently no parameter that fetches all objects available disregard how many there is totally. Just set pages to a number high enough to include the number of objects required.

Show contact

>>> crm.show_contact(12345)
{u'status': 'success',
 u'id': 12345,
 u'fields': {...},
 ...}

Reference

Create contact

>>> crm.create_contact({'firstname': 'test', 'lastname': 'creation'})
{'status': 'success',
 'item': {'id': 12347, ...},
 ...}

Reference

Update contact

>>> crm.update_contact(12345, {'firstname': 'updated', 'lastname': 'name'})
{'status': 'success',
 'item': {'id': 12345, ...},
 ...}

Reference

Destroy contact

>>> crm.destroy_contact(12345)
{'status': 'success'}

Reference

Show report activities

>>> crm.show_report_activities('2014-03-05', '2014-03-11')
{u'status': 'success',
 u'66326826': {u'comments': [],
        u'created': u'2014-03-05T08:48:07+00:00',
        u'fields': {u'assignedto': u'88842777',
        u'assignedto_cn': u'John Doe',
        u'completed': u'0',
        u'duedate': u'2014-03-07T00:00:00+00:00',
        u'priority': u'0',
        u'remindtime': u'0',
    ...},
 ...
}

Reference

Error handling

Successful requests with response.status_code == 2XX will parse the json response body and only return the response data in python data format.

Invalid requests with response.status_code == 4XX or 5XX will raise an requests.HTTPException using requests raise_for_status() returning the complete stacktrace including server error message if available.

Test

$ pip install pytest httpretty
$ py.test solve360/tests.py

Dependencies

Testing

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

solve360-0.9.2.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

solve360-0.9.2-py2.py3-none-any.whl (12.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file solve360-0.9.2.tar.gz.

File metadata

  • Download URL: solve360-0.9.2.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for solve360-0.9.2.tar.gz
Algorithm Hash digest
SHA256 1097dc662215182836d0440ec2f32feb5bf164233ddf272fd32533bb1abc4a9e
MD5 9a89f5117b56898a3b128a9291c10ba3
BLAKE2b-256 c2623c5dee50c30cc4ca9c0f79c6e1691f47a913be370f7529eb43f920b5908b

See more details on using hashes here.

File details

Details for the file solve360-0.9.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for solve360-0.9.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7a76ccb419e267e9843605b9b0272ce7eac68afc2181ea166e4cf3659dab0950
MD5 a5d68ca5a261e55f8ee3475e2889c6b2
BLAKE2b-256 9f0c60d2e1e948c70c59b2e1ec1323b4af4a8eca217248eb16153f60d8472666

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page