-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnew_offer.py
More file actions
32 lines (25 loc) · 723 Bytes
/
new_offer.py
File metadata and controls
32 lines (25 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# -*- coding: utf-8 -*-
import requests
import json
from settings import CONFIG
def new_offer(config):
full_url = '%(main_api_url)s/offer/%(market)s/' \
'%(api_user_id)s/%(api_key)s/' % (config)
send_data = {
'limit': CONFIG['limit'],
'volume': CONFIG['volume'],
'offer_type': CONFIG['offer_type'],
'api_secret': CONFIG['api_secret']
}
headers = {
'content-type': 'application/json',
'accept': 'application/json'
}
api_response = requests.post(
full_url,
data=json.dumps(send_data),
headers=headers
)
return (api_response, api_response.text)
if __name__ == "__main__":
print new_offer(CONFIG)