API CreateProductCategory returns Bad Request

Monday, November 25, 2024 8:37:51 PM
  • Posted: Friday, February 5, 2021 12:02 AM
  • 34
API for product and category creation were fine and both product and category records were created.
However when attempting to associate product to a category via API CreateProductCategory POST, a status code 400 was returned.
The API is called via Postman https://xxx.domain.com/odata/product('601923822036605a3bc28895')/CreateProductCategory and the body of the POST is as follow...
{
   'IsFeaturedProduct': false,  
   'CategoryId': '601a6f722036605a3bc46612'
}

What could I have missed?
0
  • Posted: Friday, February 5, 2021 7:25 AM
  • 953
Hello, Clarence,

Which version of GrandNode do you use? I've tried it on the newest one, and everything worked as expected. Bad request is usually returned when it's a bad syntax. Can you try with " instead of single ' ? As far as I know, JSON doesn't recognize the singlequote marks correctly in its syntax, properties should be doublequoted.
Best regards,
Patryk

GrandNode Team
0
back to top
Filters