Git Product home page Git Product logo

rd-station-api-python's Introduction

rd-station-api-python

Python for access RD Station API.

RD Developers Official Documentation

Development Environment setup

To create the development environment it's recommended to use conda. You can download and install it from the links bellow:

https://docs.conda.io/en/latest/miniconda.html https://www.anaconda.com/distribution/

Run the following commands to get the environment ready

conda create -n ENVIRONMENT_NAME python=3.7
conda activate ENVIRONMENT_NAME
pip install -r requirements.txt

Usage

Configuration

Before getting youre credentials, you need to create file auth rd_station_authentication.json:

For details on what client_id, client_secret and refresh_token are, check the developers portal.

{
  "client_id": "049bf777-bbbb-0000-9e09-7ebe2972b8b0",
  "client_secret": "952e14d9dbad9c28d2247da9a19645d8",
  "refresh_token": "refresh_token"
}
import json
from rd_station.rd_station_api import RdApi


with open('rd_station_authentication.json') as json_file:
    rd_station_authentication = json.load(json_file)

client_id = rd_station_authentication['client_id']
client_secret = rd_station_authentication['client_secret']
refresh_token = rd_station_authentication['refresh_token']

rd_api = RdApi(client_id, client_secret, refresh_token=refresh_token)

Contacts

Getting a Contact by UUID

Returns data about a specific Contact

rd_api = RdApi(client_id, client_secret, refresh_token=refresh_token)
rd_api.get_contact_by_uuid('lead_uuid')

Getting a Contact by Email

Returns data about a specific Contact

rd_api = RdApi(client_id, client_secret, refresh_token=refresh_token)
rd_api.get_contact_by_email('email')

Webhooks

Create a webhook subscription

webhook_url = "http://example-url.com"
rd_api = RdApi(client_id, client_secret, refresh_token=refresh_token)
create_webhook_response = rd_api.create_webhook(
    webhook_url,
    event_type='CONVERTED',
    include_relations=["COMPANY", "CONTACT_FUNNEL"]
)
print(create_webhook_response.json())

List all webhooks

rd_api = RdApi(client_id, client_secret, refresh_token=refresh_token)
webhooks = rd_api.list_webhooks().json()['webhooks']
print(webhooks)

rd-station-api-python's People

Contributors

barbara-sousa avatar barbara-sousa-pinto avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.