Commit 107a6338 authored by Luis Acosta's avatar Luis Acosta

Version 1.0.3

parent 61e8bc2b
......@@ -74,7 +74,7 @@ class Callcenter:
def consult_campaing(self,campaign_id,campaign_date_in,campaign_date_out):
url_center = f"{self.url}/api/outgoingcampaigns/"
url_center_aditional = url_center + f"{campaign_id}/general-metrics?page=1&search&date_from={campaign_date_in}&date_to={campaign_date_out}&maxPerPage=10000"
url_center_aditional = url_center + f"{campaign_id}/general-metrics?page=1&search&date_from={campaign_date_in}&date_to={campaign_date_out}&maxPerPage=50000"
#url_center_aditional = "https://mxcc-gruposerviandina.hiperpbx.com/api/outgoingcampaigns/90/general-metrics?page=1&search&date_from=2024-12-23&date_to=2024-12-23&maxPerPage=1000"
headers = {
......
......@@ -51,10 +51,7 @@ def login():
refresh_token = create_refresh_token(identity=usuario)
nuevo_id = db.insertar("INSERT INTO hiper_service_accesos (usuario, token ,fecha_hora, status, message) VALUES (%s, %s, %s, %s, %s)",(f'{usuario}',f'{access_token}',f'{fecha_hora}','AccessToken','OK'))
db.cerrar()
return jsonify({
"access_token": access_token,
"refresh_token": refresh_token
}), 200
return jsonify({"access_token": access_token}), 200
else:
nuevo_id = db.insertar("INSERT INTO hiper_service_accesos (usuario, token ,fecha_hora, status, message) VALUES (%s, %s, %s, %s, %s)",(f'{usuario}','',f'{fecha_hora}','AccessToken','Error'))
db.cerrar()
......@@ -169,7 +166,7 @@ def Generate_Campaign():
db_cc.cerrar()
#return jsonify({{payload}}), 200
#return jsonify({"mensaje": f"Camp Ingreso Datos: {camp_data_input} Camp Resultado: {camp_data_search} Comparacion: {result} Resgistros: {payload}"}), 200
return jsonify({"mensaje": f"Encontrado Campaing ,ID: {camp_id_search} Name: {camp_name_search} Status: {camp_status_search} Fecha Comienzo: {camp_datetime_init_search} Hora Comienzo: {camp_daytime_init_search} Fecha Fin: {camp_datetime_end_search} Hora Fin: {camp_daytime_end_search} Queue: {camp_queue_search} Responce: {data_response}! Validar Registros de Ingreso"}), 200
return jsonify({"mensaje": f"Campaing ,ID: {camp_id_search} Name: {camp_name_search} Status: {camp_status_search} Registros Ingresados"}), 200
else:
callcenter = Callcenter(api_key, cc_url)
cread_camp=callcenter.created_campaing(camp_name,date_ini_camp,time_ini_camp,date_fin_camp,time_fin_camp,campaign_queue,camp_obsv)
......@@ -193,11 +190,18 @@ def Consult_Campaign():
callcenter = Callcenter(api_key, cc_url)
consult_calls=callcenter.consult_campaing(campaign_id,campaign_date_ini,campaign_date_fin)
data_response = json.loads(consult_calls)["hydra:member"]
message = {'responce': data_response}
resp = jsonify(message)
resp.status_code = 200
return resp
#print(data_response)
raw_json = data_response[0]
#raw_json = data_response[0]
#return jsonify({"mensaje": f"Datos Ingresados , {dataCollection} ;{campaign_id};{campaign_date_ini};{campaign_date_fin}"}), 401
return jsonify(f"{raw_json}", 200)
#return jsonify({"mensaje": f"Datos Ingresados , {dataCollection} ;{campaign_id};{campaign_date_ini};{campaign_date_fin}"}), 401
#return jsonify({"response":f"{data_response}"}),200
@jwt.expired_token_loader
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment