Product
Delete product image
Deletes an image on a product. Does not delete the physical image file from storage.
DELETE/API/Product/{productId}/Image/{imageName}
Request Example
curl -X DELETE 'https://mgmtapi.geins.io/API/Product/{productId}/Image/{imageName}' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic [USER-CREDENTIALS-BASE64-ENCODED]' \
-H 'X-ApiKey: {MGMT_API_KEY}'
import axios from 'axios';
const config = {
method: 'DELETE',
url: 'https://mgmtapi.geins.io/API/Product/{productId}/Image/{imageName}',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Basic [USER-CREDENTIALS-BASE64-ENCODED]',
'X-ApiKey': '{MGMT_API_KEY}'
},
};
axios.request(config)
.then(response => response.data)
.catch(error => console.error(error));
fetch('https://mgmtapi.geins.io/API/Product/{productId}/Image/{imageName}', {
method: 'DELETE',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Basic [USER-CREDENTIALS-BASE64-ENCODED]',
'X-ApiKey': '{MGMT_API_KEY}'
}
})
.then(res => res.json())
.then((response) => response)
.catch(console.error);
import requests
url = "https://mgmtapi.geins.io/API/Product/{productId}/Image/{imageName}"
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Basic [USER-CREDENTIALS-BASE64-ENCODED]',
'X-ApiKey': '{MGMT_API_KEY}'
}
response = requests.DELETE(url, headers=headers)
print(response.json())
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
url := "https://mgmtapi.geins.io/API/Product/{productId}/Image/{imageName}"
payload := []byte{}
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Basic [USER-CREDENTIALS-BASE64-ENCODED]")
req.Header.Add("X-ApiKey", "{MGMT_API_KEY}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
using System.Text;
using System.Text.Json;
using System.Net.Http;
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Basic [USER-CREDENTIALS-BASE64-ENCODED]");
client.DefaultRequestHeaders.Add("X-ApiKey", "{MGMT_API_KEY}");
var response = await client.DELETEAsync("https://mgmtapi.geins.io/API/Product/{productId}/Image/{imageName}", null);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
Response
{
"Message": "string",
"Details": [
"string"
]
}
{
"Message": "string",
"Details": [
"string"
]
}
Add/update product image
Creates or updates an image on a product. If an image with the same file already exists it will be replaced. The image is included in the body of the request as binary data.
Add existing image to product
Adds an existing image file name to a product without uploading a new image.