Microservice django-project for sw-python-email-devino library.
Session authentication or token authentication (http://www.django-rest-framework.org/api-guide/authentication/#tokenauthentication)
After adding the sender's address, you need to contact the Devino manager to confirm the address
import requests
data = {
'address': '[email protected]'
}
requests.post('http://127.0.0.1:8000/api/add_address_sender/', json=data, headers={'Authorization': 'Token ...'})
import requests
response = requests.get('http://127.0.0.1:8000/api/get_addresses_sender/',
headers={'Authorization': 'Token ...'})
response.json()
{'code': 'ok',
'description': 'ok',
'result': [{'Confirmed': True, 'SenderAddress': '[email protected]'}]}
import requests
data = {
'recipient_email': '[email protected]',
'recipient_name': 'Test name',
'sender_email': '[email protected]',
'sender_name': 'Other test name',
'subject': 'Test subj',
'text': 'Test text',
}
response = requests.post('http://127.0.0.1:8000/api/send_message/', json=data, headers={'Authorization': 'Token ...'})
response.json()
import requests
data = {
'name': 'Test name',
'sender_email': '[email protected]',
'sender_name': 'Other test name',
'subject': 'Test subj',
'text': 'Test text',
'start': '07/15/2100 16:00',
'contact_list': [[559446, True]], # id contact group and boolean value include or not include a group in the bulk
}
requests.post('http://127.0.0.1:8000/api/add_task/', json=data, headers={'Authorization': 'Token ...'})