close
The Wayback Machine - https://web.archive.org/web/20140813150220/https://developer.beatsmusic.com/docs/read/images/Upload

User: Image

Upload an image associated to the type and id. If the intent is not set, ‘default’ is used. The upload must be a multipart/form-data encoding. Currently upload only supports user images.


Endpoint URL

/api/:type/:id/images


HTTP Method

POST


Authentication

OAuth 2.0: Access token required. See Authentication for examples and details.


Parameters

Name Required Description Example

type

required The type of the entity the image is associated to. users

id

required Unique id of the type 1234567890
upload required The file to upload filename.jpg
description optional A description of the entity. New selfie.
intent optional The intent of the image, 'default' or 'cover' default

Response Elements

ResponseDescription
code

Beats API response code. If successful, code is 'OK'. Otherwise it will be an error code.

type

The entity type of the API object

id

Unique ID of the activity

mime_type

The image's mime type.

location_prefix

The images location prefix. Used to build image URL.

parent

The parent type.

 

Object with keys corresponding to referenced object types, and values providing the bare information needed for linking to the objects.
ref_type
The API object type of the item being referred to.
id
Unique ID of the referenced item.
display
Text to be displayed when showing a link to the referenced item


Errors

InvalidArgument [409]

Invalid type <type>
The type is invalid

InvalidArgument [409]

Invalid type <type>
The file type is invalid


Who Can Upload

  • User - can upload playlists and user images only
  • Verified Artist - can also upload artist images
  • Genre Owner - can also upload genre images

Example Request

curl -F "upload=@file.jpg" https://partner.api.beatsmusic.com/v1/api/users/1234567890/images \
    -d "description=new+selfie" \
    -d "intent=default" \
    -d "access_token=[ACCESS_TOKEN]"

Example Response

{
   "code":"OK",
   "data":{
      "type":"image",
      "id":"img1234567890",
      "description":"test",
      "location_prefix":"daisy-images.s3.amazonaws.com",
      "intent": "default",
      "parent":{
         "ref_type":"artist",
         "id":"ar9999999999",
         "display":""
      }
   }
}

Docs Navigation