ondc-node icon indicating copy to clipboard operation
ondc-node copied to clipboard

Getting error as "Invalid json in response body"

Open yogesh-karpe opened this issue 3 years ago • 7 comments

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);

yogesh-karpe avatar Sep 28 '22 07:09 yogesh-karpe

@yogesh-karpe You need to run protocol server yourself or you can use the pilot one provided by ondc.

risabhsharma71 avatar Oct 03 '22 04:10 risabhsharma71

Where are details of ondc's pilot server? or how do we get api credentials? Thanks @risabhsharma71 @yogesh-karpe @ukrocks007

amitsingh08 avatar Jan 13 '23 10:01 amitsingh08

I have tried to get these details as well. I had them when I was building the package but then that portal was closed.

ukrocks007 avatar Mar 24 '23 05:03 ukrocks007

@ukrocks007 Were you able to get the credentials of the pilot server? I need to start with implementing the app in real.

mshar899 avatar Jun 02 '23 03:06 mshar899

Following

yashb042 avatar Jun 02 '23 06:06 yashb042

Pilot server urls and all tech-details: https://github.com/ONDC-Official/developer-docs/tree/main

amitsingh08 avatar Jun 02 '23 07:06 amitsingh08

Does Beckn specifications now come under ONDC? Does that mean we don't need to implement the protocol-servers(client and network side), and just the client side app (in my case it's BAP) Is there any exhaustive documentation literally giving steps for implementing.

yashb042 avatar Jun 02 '23 07:06 yashb042