Posting data to outgoing http channel

I would like to send the data to an application(where I can schedule my appointment). Is this the proper way to pass the headers?

       ![WhatsApp Image 2020-07-21 at 12.48.44 PM|690x169](upload://t7kf7G0xTUlPShaKBH3DYMUopIu.jpeg) 

I received a response : “<Response [404]>” when the service is tested using postman. Where as I could send the data to the application directly using their API.

Any help would be appreciated.

Hello @Rashmi2719,

please post your full code, rather than its screenshot, and a screenshot of your outgoing connection’s definition.

Hello @dsuch,
Here is the code of my service.

from zato.server.service import Service
from bunch import Bunch
import json
import base64
from base64 import b64encode
from json import dumps
from collections import namedtuple

class GetTourScheduleDetails(Service):
    class SimpleIO:
        input_required = ('appointment_data', 'platform_data')
        input_optional = (
            'phone_1', 'layout', 'price_ceiling', 'move_in_date', 'notes', 'first_name', 'last_name', 'email', 'start', 'token', 'id', 'platform')
        output_required = 'data'

    def load_Form_Data(self):
        data = Bunch()
        data = json.loads(self.request.raw_request)
        return data

    def get_Platform_Object(self, formData):
        # connecting to nestio platform
        if formData['platform_data']['platform'] == 'NESTIO':
            payload = {
                "appointment": {
                    "start": formData['appointment_data']['start'],
                    "tour_type": 'guided'
                "client": {
                    "people": [{
                        "first_name": formData['appointment_data']['first_name'],
                        "last_name": formData['appointment_data']['last_name'],
                        "email": formData['appointment_data']['email'],
                        "phone_1": formData['appointment_data']['phone_1']
                    "move_in_date": formData['appointment_data']['move_in_date'],
                    "layout": ["1BHK", "2BHK"],
                    "price_ceiling": formData['appointment_data']['move_in_date'],
                    "notes": formData['appointment_data']['move_in_date']
            return payload
            payload = {}
            return payload

    def handle(self):
         # data to be sent to schedule an appointment
        formData = self.load_Form_Data()'formData: {}'.format(formData))'formData Type: {}'.format(type(formData)))
        # Fetch connection to Nestio
        out = self.outgoing.plain_http.get('sendTourDetailsToNestio')
        # convert data format compatible to Nestio API
        request = self.get_Platform_Object(formData)
        params = {'group_id': formData['platform_data']['id']}
        # encoding the authorization username for HTTP Basic Auth
        userAndPass = b64encode(b"MYUSERNAME:").decode("ascii")
        headers = { 'Authorization' : 'Basic %s' %  userAndPass }
        # Adding logger to check request data and its type'Request: {}'.format(request))'Request Type: {}'.format(type(request)))
        # sending information to Nestio to schedule the appointment
        response =, str(request), params, headers = headers)'Response: {}'.format(response))'Response Type: {}'.format(type(self.response.payload)))
        # return response to the user
        res = str(response) = json.dumps(res)

The outgoing channel looks like:

I tried with no security definition also. But I still get the response code: 500 from the External server. I am not exactly sure how to post the details to the external server.

For Instance my security definition (HTTP Basic Auth) looks like:
Name: pin_nestio.basic_auth
Realm: Nestio ping

The JSON data used:

    "first_name": "xyz",
    "last_name": "hdhdhdak",
    "email": "",
    "phone_1": "7890000020101",
    "layout": [ "1bhk", "2bhk", "3bhk" ],
    "price_ceiling": 450.00,
    "move_in_date": "07/17/2020",
    "notes": "I would prefere to have a balcony",
    "start": "2020-07-23T09:15:00"},
   "id": GROUP_ID,
   "platform": "NESTIO"}

Can you please let me know the correct procedure to post the details to the external server? Thanks in Advance

Hello @Rashmi2719 ,
Please, can you include the message that Zato shows in the output? Thanks

Hello @anielkis,

Thank you for your reply. I could solve the issue. The issue was not with authorization, it is with the data format I have been sending to the external server. It worked finally.

Hello @Rashmi2719,
Good to hear that you managed to solve it.