cURL
curl --request DELETE \
--url https://api-sandbox.appcharge.com/components/v1/asset/{name} \
--header 'x-publisher-token: <api-key>'import requests
url = "https://api-sandbox.appcharge.com/components/v1/asset/{name}"
headers = {"x-publisher-token": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-publisher-token': '<api-key>'}};
fetch('https://api-sandbox.appcharge.com/components/v1/asset/{name}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-sandbox.appcharge.com/components/v1/asset/{name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-publisher-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.appcharge.com/components/v1/asset/{name}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-publisher-token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api-sandbox.appcharge.com/components/v1/asset/{name}")
.header("x-publisher-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.appcharge.com/components/v1/asset/{name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-publisher-token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "507f1f77bcf86cd799439011",
"name": "gold_coins_icon",
"type": "product",
"imageUrl": "https://media.appcharge.com/media/691d8c9f127412f152236889baf5",
"contentType": "image/png",
"externalImageUrl": "https://example.com/assets/gold_coins_icon.png"
}Assets Library
Delete Asset
Deletes an asset in the Assets Library.
DELETE
/
components
/
v1
/
asset
/
{name}
cURL
curl --request DELETE \
--url https://api-sandbox.appcharge.com/components/v1/asset/{name} \
--header 'x-publisher-token: <api-key>'import requests
url = "https://api-sandbox.appcharge.com/components/v1/asset/{name}"
headers = {"x-publisher-token": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-publisher-token': '<api-key>'}};
fetch('https://api-sandbox.appcharge.com/components/v1/asset/{name}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-sandbox.appcharge.com/components/v1/asset/{name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-publisher-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.appcharge.com/components/v1/asset/{name}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-publisher-token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api-sandbox.appcharge.com/components/v1/asset/{name}")
.header("x-publisher-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.appcharge.com/components/v1/asset/{name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-publisher-token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "507f1f77bcf86cd799439011",
"name": "gold_coins_icon",
"type": "product",
"imageUrl": "https://media.appcharge.com/media/691d8c9f127412f152236889baf5",
"contentType": "image/png",
"externalImageUrl": "https://example.com/assets/gold_coins_icon.png"
}Authorizations
Publisher token, as displayed in the Publisher Dashboard.
Path Parameters
Asset name.
Example:
"gold_coins_icon"
Response
Asset deleted successfully.
Asset ID.
Example:
"507f1f77bcf86cd799439011"
Asset name.
Example:
"gold_coins_icon"
Asset category.
Available options:
product, badge, bgMobile, bgDesk, logo, favicon, bgBundle, bgPopup, general, section, productPrefix, playerLevel, banner, addToHomeButtonImage, addToHomeIconImage, playerProfileImage, offerHeader, backToGameButtonImage, animation, trait Example:
"product"
Image URL. For uploaded files, this is the Appcharge-hosted CDN URL. For external image URLs, this is the original image URL served from your CDN at the provided URL.
Example:
"https://media.appcharge.com/media/691d8c9f127412f152236889baf5"
Original image URL if the asset uses an external image URL. This URL is served from your CDN at the provided URL.
Example:
"https://example.com/assets/gold_coins_icon.png"
Was this page helpful?
