예제 #1
0
def add_user(email, password_hash, first_name, last_name, organization=None, phone=None, 
			source_url=None, messenger_type=None, messenger_uid=None, referrer_id=None):
	params = dict(email=email, passwordHash=password_hash, firstName=first_name, lastName=last_name)
	shortcuts.dict_update_filled_params(params, organization=organization, phone=phone,
		sourceUrl=source_url, messengerType=messenger_type, messengerUid=messenger_uid,
		referrer=referrer_id)
	post(path=resource_path, params_dict=params)
예제 #2
0
def add_order(user_id, title, url, balance, cpa, type, auto_approve=True,
			  allow_negative_balance=True, reentrant=False,
			  male=None, min_age=None, max_age=None,
			  city_filter_type=None, city=[],
			  app_filter_type=None, app=[],
			  min_hour=None, max_hour=None,
			  **kwargs):
	params_dict = dict(
		userId=user_id,
		title=title,
		url=url,
        balance=balance,
		cpa=cpa,
		autoApprove=auto_approve,
		allowNegativeBalance=allow_negative_balance,
		reentrant=reentrant,
		type=type,
		**kwargs)
	
	if min_age is not None and min_age > 0: params_dict.update(minAge=min_age)
	if max_age is not None and max_age > 0: params_dict.update(maxAge=max_age)
	male = convert.to_bool(male)
	if male is not None: params_dict.update(male=male)
	if city_filter_type: params_dict.update(cityFilterType=city_filter_type, city=city)
	if app_filter_type: params_dict.update(appFilterType=app_filter_type, app=app)
	if min_hour is not None and 0 <= min_hour <= 23: params_dict.update(minHour=min_hour)
	if max_hour is not None and 0 <= max_hour <= 23: params_dict.update(maxHour=max_hour)
	
	id = post(path=resource_path, params_dict=params_dict)
	return int(id)
예제 #3
0
def add_app(title, user_id, callback, url, platform):
	id = post(path=resource_path,
		params_dict=dict(title=title,
						userId=user_id,
						callback=callback,
                        url=url,
                        platform=platform))
	return int(id)
예제 #4
0
def add_user_role(user_id, role):
	path = "{0}/{1}/roles".format(resource_path, user_id)
	post(path=path, params_dict=dict(role=role))
예제 #5
0
def make_user_withdrawal(user_id, amount):
	path = "{0}/{1}/developer-account/withdraws".format(resource_path, user_id)
	return post(path=path, params_dict=dict(amount=amount))
def add_mlm_invite(from_id, to_id, app_id):
	post(path=resource_path,
		params_dict=dict(extId=to_id,
						inviterExtId=from_id,
						appId=app_id))
예제 #7
0
def add_city(name):
	params_dict = dict(name=name)
	id = post(path=resource_path, params_dict=params_dict)
	return int(id)
예제 #8
0
def add_order_banner(order_id, banner_size, mime_type, image):
	path = "{0}/{1}/banners".format(resource_path, order_id)
	params = dict(bannerSize=banner_size, mimeType=mime_type, image=image)
	post(path=path, params_dict=params)
def transfer(account_from_id, account_to_id, amount):
	path = '{0}/transfer'.format(resource_path)
	params = { 'from' : account_from_id, 'to' : account_to_id, 'amount' : amount }
	return post(path=path, params_dict=params)
def add_banner_size(width, height):
	params_dict = dict(width=width,	height=height)
	id = post(path=resource_path, params_dict=params_dict)
	return int(id)