Same error:
2019-04-22 13:43:49,328 ERROR [actions_component] <task[functionworker] (<function _call_the_task at 0x7fcfc7f18c08>, <utilities_call_rest_api[functions.utilities_call_rest_api] (id=7, workflow=abrirpricion, user=
resapi@xelere.com) 2019-04-22 16:43:48.884000> rest_body={u'content': u'\r\n{\r\n "ResilientQ": {\r\n "Categoria": "Seguridad",\r\n "Subcategoria": "S.O/Plataformas -- Cloud -- Consulta/Capacitaci\xf3n",\r\n "GrupoAsignado": "SEGURIDAD-ANTIVIRUS",\r\n "SolicitadoPara": "falcon",\r\n "FechaRequerida": "2019-04-25T03:00:00",\r\n "SolicitadoPor": "falcon",\r\n "Descripcion": ["\'zxczx\'"],\r\n "Titulo": "zxcc",\r\n "GrupoRegistradoPor": "ACCESO-PERIMETRAL-LAM",\r\n "Fase": "Registro",\r\n "RESTaskID": 2679556,\r\n "RESIncidentID": 6732,\r\n "RESTaskName": "Interview key individuals"\r\n \r\n }\r\n}\r\n', u'format': u'text'}, rest_verify=False, rest_url=u'http://10.4.0.14:25001/SM/9/rest/ResilientQ/', rest_method={u'name': u'POST', u'id': 508}, rest_headers={u'content': u'\r\nContent-Type: application/json\r\nX-Frooble: Baz\r\nAuthorization: Basic ZmFsY29uOlBhc3N3MHJk\r\n', u'format': u'text'})> (<class 'resilient_circuits.action_message.FunctionException_'>): FunctionException_: <Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/fn_utilities/components/utilities_call_rest_api.py", line 43, in _call_rest_api_function
verify=rest_verify)
File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/adapters.py", line 440, in send
timeout=timeout
File "/usr/local/lib/python2.7/site-packages/urllib3/connectionpool.py", line 601, in urlopen
chunked=chunked)
File "/usr/local/lib/python2.7/site-packages/urllib3/connectionpool.py", line 357, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/local/lib/python2.7/httplib.py", line 1042, in request
self._send_request(method, url, body, headers)
File "/usr/local/lib/python2.7/httplib.py", line 1082, in _send_request
self.endheaders(body)
File "/usr/local/lib/python2.7/httplib.py", line 1038, in endheaders
self._send_output(message_body)
File "/usr/local/lib/python2.7/httplib.py", line 886, in _send_output
self.send(message_body)
File "/usr/local/lib/python2.7/httplib.py", line 858, in send
self.sock.sendall(data)
File "/usr/local/lib/python2.7/socket.py", line 228, in meth
return getattr(self._sock,name)(*args)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 123: ordinal not in range(128)
>
File "/usr/local/lib/python2.7/site-packages/circuits/core/manager.py", line 856, in processTask
raise value.extract()
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/circuits/core/manager.py", line 617, in _dispatcher
event_handlers = self._cache[(event.name, channels)]
KeyError: ('exception', ('*',))
------------------------------
Juan Cruz Del Col
------------------------------
Original Message:
Sent: Mon April 22, 2019 11:22 AM
From: Brian Walsh
Subject: Call REST API
Hi Juan,
You can try putting a lower case u
character right before the double quote of what you are setting inputs.rest_body to.
ie:
inputs.rest_body = u"""..."""
This should tell it to handle the string as Unicode instead of ASCII.
------------------------------
Brian Walsh
Original Message:
Sent: Mon April 22, 2019 09:29 AM
From: Juan Cruz Del Col
Subject: Call REST API
Any suggestions?
------------------------------
Juan Cruz Del Col
Original Message:
Sent: Mon April 15, 2019 03:10 PM
From: Juan Cruz Del Col
Subject: Call REST API
Brian, in destiny wait for a string value.
------------------------------
Juan Cruz Del Col
Original Message:
Sent: Mon April 15, 2019 01:25 PM
From: Brian Walsh
Subject: Call REST API
Hi Juan,
Is it possible to make this call using IDs instead of the string value?
------------------------------
Brian Walsh
Original Message:
Sent: Fri April 12, 2019 12:42 PM
From: Juan Cruz Del Col
Subject: Call REST API
Design a workflow which sends through REST API to a third party system the creation of a request.
Within the action generate 4 fields and one of them has an "accent" which is giving me problems at the time of shipment.

The problem is with the "Categoria" field in action, in the script is "Clasificacion"
Inside my pre-script:
Categoria1 = str('"Seguridad"')Titulo = str('"'+rule.properties.titulo+'"')description1 = rule.properties.descripcion['content']description2 = description1.replace('"', '\'')desc = repr(description2)description6 = desc.replace('u', '', 1)description7 = str('"'+description6+'"')GrupoAsignado = str('"'+rule.properties.gruposm+'"')Clasificacion = rule.properties.categoriatext = workflow.properties.fecha_salida.stdouttext2 = text.replace("\n", "")FechaRequerida = str('"'+text2+'"')RESIncidentID = str(incident.id)RESTaskID = str(task.id)algo = repr(task.name)RESTaskName = algo.replace('u', '', 1)RESTaskName1 = RESTaskName.replace('\'', '')RESTaskName2 = str('"'+RESTaskName1+'"')inputs.rest_body = """{ "ResilientQ": { "Categoria": "Seguridad", "Subcategoria": """+Clasificacion+""", "GrupoAsignado": """+GrupoAsignado+""", "SolicitadoPara": "falcon", "FechaRequerida": """+FechaRequerida+""", "SolicitadoPor": "falcon", "Descripcion": ["""+description7+"""], "Titulo": """+Titulo+""", "GrupoRegistradoPor": "ACCESO-PERIMETRAL-LAM", "Fase": "Registro", "RESTaskID": """+RESTaskID+""", "RESIncidentID": """+RESIncidentID+""", "RESTaskName": """+RESTaskName2+""" }}"""
When executing the ction I am asked to complete the fields and one of them, the one that frames, has that "ascent" that I understand is the cause of the failure because if I choose another option without "ascento" it works perfect.
The error that can be seen in the logs:
"UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 122: ordinal not in range(128)"
Any suggestions?
------------------------------
Juan Cruz Del Col
------------------------------