Skip to main content

DacWin API

The Python package dacwinapi makes it easy to manage information about your DacWin referral system. This package is specifically designed to interact with the DacWin API and allows you to manage information about an application's users, referral campaigns, rewards and events.

DacWin home page: https://referral-dev.dactechnologies.net

Installation

To install dacwinapi, you can use pip:

pip install dacwinapi

Before using this package you must have the API key of the application you want to manage. If this is not the case yet,

  • Go to your customer area: https://referral-devuser.dactechnologies.net
  • In the Applications section:
    • Add an application and copy the generated API key.
    • Or, open your application's edit window and regenerate a new API key if you no longer have the old one.

How to use this package

1. Campaigns

from dacwinapi import CampaignService

# create an instance of CampaignService
campaignService = CampaignService(api_key="your_app_api_key")

# retrieve the list of campaigns of the app
campaigns = campaignService.getAll()

# retrieve one campaign data
campaigns = campaignService.getOne(1) # 1 is the campaign id 

NOTE: Creating a campaign is only done on your DacWin customer interface.

2. App users

from dacwinapi import AppUserService

# create an instance of AppUserService
appUserService = AppUserService(api_key="your_app_api_key")

# add new app user with referral information
app_user_created = await appUserService.create(
	reference="3ddd",
	referrer_referral_code="AAAAA"
)

print(app_user_created)

# retrieve the list of app users of the app
app_users = appUserService.getAll()

# retieve one app user by her id
app_user = appUserService.getOne(id=1) # 2 is the app user id

# retieve one app user by her reference
app_user = appUserService.getOne(reference="a2sddd") # "a2sddd" is the app user reference

3. Events

from dacwinapi import EventService

# create an instance of EventService
eventService = EventService(api_key="your_app_api_key")

# add a new event for specific app user and campaign
event_created = eventService.create(
	name="ddd",
	campaign_id=18,
	app_user_id=14
)

print(event_created)

# retrieve the list of events of the app
events = eventService.getAll()

# retrieve the list of app's events of specific campaign
events = eventService.getAll(campaign_id=12)

# retrieve one event
event = eventService.getOne(12) # 12 is the event id

4. Rewards

from dacwinapi import RewardService

# create an instance of RewardService
rewardService = RewardService(api_key="your_app_api_key")

# retrieve the list of rewards of the app
rewards = rewardService.getAll()

# retrieve the list of app's rewards of specific campaign
rewards = rewardService.getAll(campaign_id=12)

# retrieve one reward
reward = rewardService.getOne(id=12)

Release files for dacwinapi 2.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dacwinapi 2.2.0
File Size Uploaded
dacwinapi-2.2.0.tar.gz 6.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dacwinapi 2.2.0
File Interpreter ABI Platform
dacwinapi-2.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.6 kB

Release files / dacwinapi-2.2.0.tar.gz

Download URL dacwinapi-2.2.0.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
78d0c1dbeb8647c6d66332c420cd6fad0aeea8e983f24c96f7c8290bd971c4d2
BLAKE2b-256 checksum
How to use checksums
4c32e79bb7e71bb30da68072fba9a81963a0007ff9891c21997e8c1bb382dd4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release files / dacwinapi-2.2.0-py3-none-any.whl

Download URL dacwinapi-2.2.0-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f1845f98a177db8fdf2d23634a866728f46513aa1e0aedc7ebcee5d56d0bca9e
BLAKE2b-256 checksum
How to use checksums
24ca929de5757a56b4c2841d65b38b9fac9afef1920b25947cfad37efb540a83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release history Release notifications | RSS feed

This release

2.2.0 This release

2 release files

2.1.9

2 release files

2.1.8

2 release files

2.1.7

2 release files

2.1.6

2 release files

2.1.5

2 release files

2.1.4

2 release files

2.1.3

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page