An instance of GrandNode v4.9 was deployed in 2020 and I'm tasked to test migration for Extended Web API for GrandNode v2.0.
Both Product and image creation was fine, i.e. records appeared in database. However calling POST /odata/product('id')/CreateProductPicture to associate picture to product resulted in 404 (Not Found).
The body of the POST is JSON data { 'PictureId': '6351fba61b22e19aeb692bc2', 'MimeType': 'image/webp' }
Has GrandNode team tested Extended Web API v2.0? The plugin was working for v4.9.
Extended Web API - CreateProductPicture 404
Friday, December 27, 2024 8:49:30 PM
Hi,
Plugin does not cover support for picture controller.
This features are available without plugin.
More information you can find here: https://github.com/grandnode/grandnode2/blob/master/src/API/Grand.Api/Controllers/OData/PictureController.cs
Plugin does not cover support for picture controller.
This features are available without plugin.
More information you can find here: https://github.com/grandnode/grandnode2/blob/master/src/API/Grand.Api/Controllers/OData/PictureController.cs
0
I spend a few hours just to go through methods for operations on Product using Postman.
Many methods resulted in 404, like GET /odata/product('id'), PATCH /odata/product('id'), DELETE /odata/product('id'), POST /odata/product('id')/UpdateStock, POST /odata/product('id')/CreateProductCategory, POST /odata/product('id')CreateProductPicture.
Are the methods name correct in GrandNode2? These are methods that used to work in v4.9.
How can I list the available methods in Extended Web API v2.02 as the documentation seem to be a direct copy from v4.9.
I suppose the migration is quick and underestimated the time required to trial and error.
Many methods resulted in 404, like GET /odata/product('id'), PATCH /odata/product('id'), DELETE /odata/product('id'), POST /odata/product('id')/UpdateStock, POST /odata/product('id')/CreateProductCategory, POST /odata/product('id')CreateProductPicture.
Are the methods name correct in GrandNode2? These are methods that used to work in v4.9.
How can I list the available methods in Extended Web API v2.02 as the documentation seem to be a direct copy from v4.9.
I suppose the migration is quick and underestimated the time required to trial and error.
0
Hi,
I've just tested Create new products and works well.
About pictures:
1. First request is for create picture:
POST: https://localhost:44350/odata/picture/
and sample body:
{
"id": "",
"pictureBinary": "iVBOR..", //base64
"mimeType": "png",
"seoFilename": "string",
"altAttribute": "string",
"titleAttribute": "string",
"reference": 40, //this enum = 40 is product -- it's recommended
"objectId": "633da317476b0157393a425b", //id product - it's recommended
"style": "string",
"extraField": "",
"isNew": true
}
reference and objectId - will be used to auto map (in the next release of application)
2. Next request is mapping product with picture
POST: https://localhost:44350/odata/product/(633da317476b0157393a425b)/CreateProductPicture
Body:
{
"PictureId": "6356bf1e0b711622d34c5502",
"DisplayOrder": 10
}
633da317476b0157393a425b - productId
and that's it
I've just tested Create new products and works well.
About pictures:
1. First request is for create picture:
POST: https://localhost:44350/odata/picture/
and sample body:
{
"id": "",
"pictureBinary": "iVBOR..", //base64
"mimeType": "png",
"seoFilename": "string",
"altAttribute": "string",
"titleAttribute": "string",
"reference": 40, //this enum = 40 is product -- it's recommended
"objectId": "633da317476b0157393a425b", //id product - it's recommended
"style": "string",
"extraField": "",
"isNew": true
}
reference and objectId - will be used to auto map (in the next release of application)
2. Next request is mapping product with picture
POST: https://localhost:44350/odata/product/(633da317476b0157393a425b)/CreateProductPicture
Body:
{
"PictureId": "6356bf1e0b711622d34c5502",
"DisplayOrder": 10
}
633da317476b0157393a425b - productId
and that's it
0
Let's start with a simple example.
Using Postman, I create a new product using GET and got the id : 635b6d4c246dad138307b717
When I tried to delete the above product using DELETE command, I get a 404 Not Found Error
https://simplex.sgvmart.com/odata/product('635b6d4c246dad138307b717')
I can send the API key separately to your email if you need to test on the above URL.
Using Postman, I create a new product using GET and got the id : 635b6d4c246dad138307b717
When I tried to delete the above product using DELETE command, I get a 404 Not Found Error
https://simplex.sgvmart.com/odata/product('635b6d4c246dad138307b717')
I can send the API key separately to your email if you need to test on the above URL.
0