Skip to content

Getting error as "Invalid json in response body" #3

@yogesh-karpe

Description

@yogesh-karpe

Please refer following code.

const instance = new ondc.ONDC({ "host": "http://localhost:5000", "action": "search", "bapId": "ondc.gofrugal.com/ondc/18275", "bapUri": "https://ondc.gofrugal.com/ondc/seller/adaptor", "bppId": "ondc.yaarilabs.com", "bppUri": "https://ondc.yaarilabs.com/", "domain": "nic2004:60232", "country": "IND", "city": "std:080", "ttl": "PT30S", "key": "<encryption key>", "signingPublicKey" : "<signing key>", "privateKey" : "<private key>", "uniqueKey" : "<uniqueKey>", "subscriberId" : "<subscriberId>" });

let body = {
        "item": {
            "descriptor": {
                "name": "Milk"
            }
        },
        "fulfillment": {
            "end": {
                "location": {
                    "gps": "12.4535445,77.9283792"
                }
            }
        }
    };

instance.apiKey = await instance.createAuthorizationHeader(body);
let result = await instance.search(body);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions