cURL
curl --request GET \
--url https://api-sandbox.appcharge.com/components/v1/asset \
--header 'x-publisher-token: <api-key>'import requests
url = "https://api-sandbox.appcharge.com/components/v1/asset"
headers = {"x-publisher-token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-publisher-token': '<api-key>'}};
fetch('https://api-sandbox.appcharge.com/components/v1/asset', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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"
req, _ := http.NewRequest("GET", 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.get("https://api-sandbox.appcharge.com/components/v1/asset")
.header("x-publisher-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.appcharge.com/components/v1/asset")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.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://example.com/assets/gold_coins_icon.png",
"contentType": "image/png",
"externalImageUrl": "https://example.com/assets/gold_coins_icon.png"
},
{
"id": "507f1f77bcf86cd799439012",
"name": "summer_sale_badge",
"type": "badge",
"imageUrl": "https://media.appcharge.com/media/691d8c97d-4b55c292b2cg6",
"contentType": "image/jpeg"
}
]
Assets Library
Get All Assets
Retrieves a list of all assets in the Assets Library.
GET
/
components
/
v1
/
asset
cURL
curl --request GET \
--url https://api-sandbox.appcharge.com/components/v1/asset \
--header 'x-publisher-token: <api-key>'import requests
url = "https://api-sandbox.appcharge.com/components/v1/asset"
headers = {"x-publisher-token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-publisher-token': '<api-key>'}};
fetch('https://api-sandbox.appcharge.com/components/v1/asset', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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"
req, _ := http.NewRequest("GET", 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.get("https://api-sandbox.appcharge.com/components/v1/asset")
.header("x-publisher-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.appcharge.com/components/v1/asset")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.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://example.com/assets/gold_coins_icon.png",
"contentType": "image/png",
"externalImageUrl": "https://example.com/assets/gold_coins_icon.png"
},
{
"id": "507f1f77bcf86cd799439012",
"name": "summer_sale_badge",
"type": "badge",
"imageUrl": "https://media.appcharge.com/media/691d8c97d-4b55c292b2cg6",
"contentType": "image/jpeg"
}
]
[
{
"id": "507f1f77bcf86cd799439011",
"name": "gold_coins_icon",
"type": "product",
"imageUrl": "https://example.com/assets/gold_coins_icon.png",
"contentType": "image/png",
"externalImageUrl": "https://example.com/assets/gold_coins_icon.png"
},
{
"id": "507f1f77bcf86cd799439012",
"name": "summer_sale_badge",
"type": "badge",
"imageUrl": "https://media.appcharge.com/media/691d8c97d-4b55c292b2cg6",
"contentType": "image/jpeg"
}
]
Was this page helpful?
⌘I
