32 lines
949 B
Python
32 lines
949 B
Python
import os
|
|
from flask import Blueprint, current_app, request, jsonify
|
|
|
|
campaign = Blueprint('campaign', __name__)
|
|
|
|
@campaign.route('/account', methods=['GET'])
|
|
def get_twitter_accounts():
|
|
content_type = request.headers.get('Content-Type')
|
|
if (content_type == 'application/json'):
|
|
json = request.json
|
|
return json
|
|
else:
|
|
return 'Content-Type not supported!'
|
|
|
|
@campaign.route('/account', methods=['POST'])
|
|
def add_twitter_account():
|
|
content_type = request.headers.get('Content-Type')
|
|
if (content_type == 'application/json'):
|
|
json = request.json
|
|
return json
|
|
else:
|
|
return 'Content-Type not supported!'
|
|
|
|
@campaign.route('/account', methods=['DELETE'])
|
|
def delete_twitter_account():
|
|
content_type = request.headers.get('Content-Type')
|
|
if (content_type == 'application/json'):
|
|
json = request.json
|
|
return json
|
|
else:
|
|
return 'Content-Type not supported!'
|