· 7 years ago · Aug 28, 2018, 02:46 PM
1# -*- coding: utf-8 -*-
2
3# parse
4login_url = 'https://zoloto585.directcrm.ru/authenticateByUserNameAndPassword'
5data_url = 'https://zoloto585.directcrm.ru/customers/actions?filter=segment(g(zoloto585SMSMailingActionsList)h(f)a(f)n(f))'
6req_headers = {
7 'Content-Type': 'application/json',
8 'accept': '*/*'
9}
10formdata = {
11 'userName': 'Oreshkin.Sergey@zoloto585.ru',
12 'password': 'PD8kWRqo'
13}
14
15
16# json & sql
17con_str = "Driver={SQL Server};Server=spb-s-dwh1;Database=dwh;Uid=kim.lestat;Pwd=q3dm12"
18url = "https://api.mindbox.ru/v3/operations/sync?endpointId=zoloto585.analytics&operation=zoloto585"
19key = 'Mindbox secretKey="HLFkT5sjA1SIsiX5wpCb"'
20insert_promo = """
21INSERT INTO stg.mindbox.Promo (MindBoxId, Id, Name, ActionId, Channel, SendDate, ClientGroup, firstMindboxId)
22 VALUES
23"""
24insert_client = """
25INSERT INTO stg.mindbox.Client (MindBoxId, SapId, CardNumber, PhoneNumber)
26 VALUES
27"""
28select_mindboxId = """
29SELECT DISTINCT p.MindBoxId
30FROM dwh.mindbox.Promo AS p
31WHERE NOT EXISTS (
32 SELECT 1
33 FROM dwh.mindbox.Client AS c
34 WHERE p.MindBoxId = c.MindBoxId
35)
36"""
37
38'''
39{
40 "page": {
41 "itemsPerPage": 1000,
42 "firstMindboxId": 63497172
43
44 }
45}
46
47'''