Forum Stats

  • 3,767,980 Users
  • 2,252,736 Discussions
  • 7,874,399 Comments

Discussions

how to process body content in received REST POST call

Hi everyone,

I need to process a received POST call that contains a json of the type:

{

    "partnerID": "DEM79000500",

    "partnerName": "Empresa Demostracion ",

    "transactionID": "",

    "Version": "1.0",

    "QuantityTotal": 1,

    "Quantity": 1,

    "Page": 1,

    "PageSize": 50,

    "PagesTotal": 1,

    "customer": [

        {

            "RecNumber": 1,

            "ID": "GEN77965450",

            "Nationality": {

                "CT_Code": "GEN",

                "ISO_3166-2": "G1",

                "ISO_3166-3": "GEN",

                "ISO_3166-Num": "000"

            },

            "NationalID": "77960000",

            "CheckDigit": "K",

            "Name": "Transporte Siglo XX",

            "LastName": null,

            "CommBusiness": "Transportes",

            "CustomerSegment": {

                "ID": 7,

                "Description": "grandes"

            },

            "SalesMan": {

                "ID": "CHL6898000",

                "Name": "Diego",

                "lastName": "Santos"

            },

            "CollectExe": {

                "ID": "CHL24000000",

                "Name": "Manuel",

                "lastName": "Diaz"

            },

            "address": {

                "Quantity": 1,

                "List": [

                    {

                        "Number": 1,

                        "customerID": "GEN77965450",

                        "ID": 345,

                        "Type": {

                            "partnerCode": null,

                            "CT_Code": "COB",

                            "CT_Name": "Cobranza"

                        },

                        "Status": {

                            "partnerCode": null,

                            "CT_Code": "ACT",

                            "CT_Name": "Activo"

                        },

                        "Region": {

                            "partnerCode": null,

                            "CT_Code": "013",

                            "CT_Name": "XIII Metropolitana de Santiago"

                        },

                        "City": {

                            "partnerCode": null,

                            "CT_Code": "131",

                            "CT_Name": "Santiago"

                        },

                        "Commune": {

                            "partnerCode": "STG1",

                            "CT_Code": "13101",

                            "CT_Name": "Santiago"

                        },

                        "Address": "Ingresar Dirección",

                        "Phone_1": "Ingresar Teléfono",

                        "Phone_2": null,

                        "Mobile_1": "Ingresar Movil",

                        "Mobile_2": null,

                        "e-mail": "[email protected]",

                        "Comment": null

                    }

                ]

            }

        }

    ]

}


to do this I need to pass the body to a function of its own.

your help is greatly appreciated

Thank you so much


Carlos

Tagged:

Answers