REST API- Product Inventory Open API

Aijaz1
Tera Contributor

Hi, I was exploring product inventory open API in  San Diego and wanted to create some order so I went to REST API Explorer ,set the namespace to "sn_prd_invt" ,set the POST http method and added the payload in request body which I copied from this website "docs.servicenow.com/bundle/sandiego-application-development/page/integrate/inbound-rest/concept/prod..." .Attaching the payload that I used in the request body for reference

{
   "pid": "demoInventory",
   "description": "inventory description",
   "isBundle": false,
   "name": "Voice Over IP Basic instance for Jean",
   "productOffering": {
      "id": "69017a0f536520103b6bddeeff7b127d",
      "name": "Premium SD-WAN Offering",
      "@referredType": "ProductOffering"
   },
   "productCharacteristic": [
      {
         "name": "CPE Type",
         "valueType": "choice",
         "value": "Virtual"
      },
      {
         "name": "Routing",
         "valueType": "choice",
         "value": "Premium"
      }
   ],
   "productRelationship": [
      {
         "productId": "7e6d13f45b5620102dff5e92dc81c787",
         "relationshipType": "child"
      }
   ],
   "relatedParty": [
      {
         "id": "eaf68911c35420105252716b7d40ddde",
         "name": "Sally Thomas",
         "role": "User",
         "@type": "RelatedParty",
         "@referredType": "CustomerContact"
      },
      {
         "id": "ffc68911c35420105252716b7d40dd55",
         "name": "Funco Intl",
         "@type": "RelatedParty",
         "@referredType": "Customer"
      }
   ],
   "productSpecification": {
      "id": "cfe5ef6a53702010cd6dddeeff7b12f6",
      "@referredType": "ProductSpecification",
      "version": "1"
   },
   "id": "3ac715c6745d8150f877ca57242ff97a"
}

 I am getting the below error while running this payload

{
  "code": 21,
  "reason": "Invalid payload: Request body missing",
  "message": "Invalid payload: Request body missing",
  "details": [
    {
      "message": "Invalid payload: Request body missing",
      "datapath": ""
    }
  ]
}

Can anyone help me with this issue.

Thanks

 

NOTE: Demo data is already installed in my PDI.

5 REPLIES 5

Tony Chatfield1
Kilo Patron

Hi, looking at your request body it shows a sys_id for 'id' in the main record
and so I suspect this was either the example response from the snippet above it , or the example is incorrect.

Perhaps try the previous snippet.

Hi Tony, i tried with the other snippet too but got the same response as above.

ajayr
Giga Expert

Hello Aijaz, Were you able to get resolve this issue, as I am also facing the same issue.

Thanks,

Ajay

amitroy
Tera Contributor

Hi Folks, Any resolution for this issue.

I am also getting the same