Skip to main content
POST
/
components
/
v1
/
asset
cURL
curl --location 'https://api-sandbox.appcharge.com/components/v1/asset' \
--header 'x-publisher-token: TOKEN' \
--form 'type="product"' \
--form 'name="filename"' \
--form 'file=@"PATH/TO/FILE"'
{
  "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

x-publisher-token
string
header
required

Publisher token, as displayed in the Publisher Dashboard.

Body

Upload asset via file.

type
enum<string>
required

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"

name
string
required

Asset name.

Example:

"gold_coins_icon"

file
file
required

A valid PNG or JPEG image file. Maximum size is 2 MB.

Response

Asset uploaded successfully.

id
string

Asset ID.

Example:

"507f1f77bcf86cd799439011"

name
string

Asset name.

Example:

"gold_coins_icon"

type
enum<string>

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"

imageUrl
string<url>

Image URL in the Assets Library.

Example:

"https://media.appcharge.com/media/691d8c9f127412f152236889baf5"

contentType
string

Image MIME type.

Example:

"image/png"

externalImageUrl
string<url>

Original URL of the image if uploaded via external link.

Example:

"https://example.com/assets/gold_coins_icon.png"