Skip to main content

Salesmanago Tools is a project designed to simplify working with the Salesmanago API

Project description

salesmanago-tools

Python Class for SalesManago integration.

Installation

pip install salesmanago-tools

Third Party Libraries and Dependencies

The following libraries will be installed when you install the client library:

  • requests
  • aiohttp
  • pandas

Class

Start with import from salesmanago_tools.utils import SalesmanagoDataClient

Initialization

salesmanago_client = SalesmanagoDataClient(
    clientId="YOUR CLIENT_ID",
    apiKey="YOUR API_KEY",
    sha="YOUR OWNER_EMAIL",
    owner="YOUR SHA",
    account_name="YOUR ACCOUNT_NAME"
)

Export data with example

Initiates the export process for specific data and returns the data as a CSV generator.

  • param value: The value associated with the export, such as an email or tag.
  • param addresseeType: The type of recipient (default is "tag").
  • return: A CSV generator containing the exported data.
async def example_call_export_data():
    contacts = await salesmanago_client.export_data(value="TEST_TAG", addresseeType="tag")
    return contacts


asyncio.run(example_call_export_data())

This function will make a request to export contacts by tag TEST_TAG

Fetch all contacts from salesmanago

Fetches all contacts from SalesManago and returns them as a list.

  • param page_size: The number of contacts to retrieve per request (default is 1000).
  • param page: The page number to fetch (default is 1).
  • return: A list of contacts, with each contact formatted as a list of details.
async def example_call_fetch_all_contacts_from_salesmanago():
    contacts = await salesmanago_client.fetch_all_contacts_from_salesmanago()
    return contacts


asyncio.run(example_call_fetch_all_contacts_from_salesmanago())

This function will make a request to export all contacts without any filters

Push people to salesmanago

Pushes a list of people to Salesmanago for upsert, handling each person's details and tags.

  • param people_list_to_push: A list of people data (dictionaries) ("Email", "Phone", "Country", "City", "Name", "properties") to push to Salesmanago.
  • param tags: A list of tags to associate with each person (default is an empty list).
  • return: None
async def example_call_push_people_to_salesmanago():
    await salesmanago_client.push_people_to_salesmanago(
        people_list_to_push=[
            {
                "Email": "example@gmail.com",
                "Phone": "+380000000000",
                "Country": "Ukraine",
                "City": "Dnipro",
                "Name": "Name Surname",
                "properties": {
                    "property1": 1000,
                    "property2": False,
                    "property3": "3000"

                }
            },
            {
                "Email": "example2@gmail.com",
                "Phone": "+38111111111",
                "Country": "Ukraine",
                "City": "Kharkiv",
                "Name": "Name Second Surname",
                "properties": {
                    "property1": 1000,
                    "property2": False,
                    "property3": "3000"

                }
            },
        ],
        tags=["TAG1, TAG2"]
    )


asyncio.run(example_call_push_people_to_salesmanago())

In this example we have added two people, each of them will have tags TAG1 and TAG2

Update tag salesmanago

Updates the tags for a specific contact in Salesmanago.

  • param email: The email of the contact whose tags are to be updated.
  • param tags: A list of tags to assign to the contact.
  • param call_id: An optional call ID to associate with the contact.
  • return: None
async def example_call_update_tag_salesmanago():
    await salesmanago_client.update_tag_salesmanago(
        email="example@gmail.com", 
        tags=["TAG1", "TAG2"]
    )

asyncio.run(example_call_update_tag_salesmanago())

In this example we have added TAG1 and TAG2 tags to person whose email is example@gmail.com

Get contact info by email

Retrieves detailed contact information by email from Salesmanago.

  • param contact_email: The email of the contact to retrieve information for.
  • return: A dictionary with contact details including name, company, tags, and other properties.
async def example_call_get_contact_info_by_email():
    contact = await salesmanago_client.get_contact_info_by_email(contact_email="example@gmail.com")
    return contact

asyncio.run(example_call_get_contact_info_by_email())

In this example, we got additional information about the user knowing only his email.

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

salesmanago-tools-0.1.9.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

salesmanago_tools-0.1.9-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file salesmanago-tools-0.1.9.tar.gz.

File metadata

  • Download URL: salesmanago-tools-0.1.9.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.6

File hashes

Hashes for salesmanago-tools-0.1.9.tar.gz
Algorithm Hash digest
SHA256 7a337426985057a80322b8bbadea53734a8cb549ecfba71b65c59d2360b09947
MD5 106a5b352b1ba72bd4b3346b26c3f679
BLAKE2b-256 3982e3ad23b5c1d6f94f5f08552ba861940c767f1c2c5fcdbb62ffd0812e6c75

See more details on using hashes here.

File details

Details for the file salesmanago_tools-0.1.9-py3-none-any.whl.

File metadata

File hashes

Hashes for salesmanago_tools-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 b060d081b7c436c17281076d5cfb6192ec70a3aaf414aa6fb237e1a3405450ae
MD5 ff2888cb6e59eaf2bbc319c4e01492d1
BLAKE2b-256 b6c5ea03903cf0f1e2ac93c6c4c20d84f4955dc5fb09b7438c4a00991f5910df

See more details on using hashes here.

Supported by

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