Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
W
Webservice Marcimex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Luis Acosta
Webservice Marcimex
Commits
107a6338
Commit
107a6338
authored
Dec 24, 2024
by
Luis Acosta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Version 1.0.3
parent
61e8bc2b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
Connect_CC2.py
Connect_CC2.py
+1
-1
app.py
app.py
+12
-8
No files found.
Connect_CC2.py
View file @
107a6338
...
...
@@ -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=
1
0000"
url_center_aditional
=
url_center
+
f
"{campaign_id}/general-metrics?page=1&search&date_from={campaign_date_in}&date_to={campaign_date_out}&maxPerPage=
5
0000"
#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
=
{
...
...
app.py
View file @
107a6338
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment