music.listens

Returns no data as of April 4, 2018.

An action representing someone listening to a song, album, radio station, playlist or musician

Create
/* make the API call */
FB.api(
    "/me/music.listens",
    "POST",
    {
        "song": "http:\/\/samples.ogp.me\/461258627226537",
        "radio_station": "http:\/\/samples.ogp.me\/461258533893213",
        "album": "http:\/\/samples.ogp.me\/461258347226565",
        "playlist": "http:\/\/samples.ogp.me\/461258467226553",
        "musician": "http:\/\/samples.ogp.me\/390580850990722"
    },
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
NSDictionary *params = @{
  @"song": @"http://samples.ogp.me/461258627226537",
  @"radio_station": @"http://samples.ogp.me/461258533893213",
  @"album": @"http://samples.ogp.me/461258347226565",
  @"playlist": @"http://samples.ogp.me/461258467226553",
  @"musician": @"http://samples.ogp.me/390580850990722",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/me/music.listens"
                                      parameters:params
                                      HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
Bundle params = new Bundle();
params.putString("song", "http://samples.ogp.me/461258627226537");
params.putString("radio_station", "http://samples.ogp.me/461258533893213");
params.putString("album", "http://samples.ogp.me/461258347226565");
params.putString("playlist", "http://samples.ogp.me/461258467226553");
params.putString("musician", "http://samples.ogp.me/390580850990722");
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/me/music.listens",
    params,
    HttpMethod.POST,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->post(
    '/me/music.listens',
    array (
      'song' => 'http://samples.ogp.me/461258627226537',
      'radio_station' => 'http://samples.ogp.me/461258533893213',
      'album' => 'http://samples.ogp.me/461258347226565',
      'playlist' => 'http://samples.ogp.me/461258467226553',
      'musician' => 'http://samples.ogp.me/390580850990722',
    ),
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
POST /v3.0/me/music.listens HTTP/1.1
Host: graph.facebook.com

song=http%3A%2F%2Fsamples.ogp.me%2F461258627226537&radio_station=http%3A%2F%2Fsamples.ogp.me%2F461258533893213&album=http%3A%2F%2Fsamples.ogp.me%2F461258347226565&playlist=http%3A%2F%2Fsamples.ogp.me%2F461258467226553&musician=http%3A%2F%2Fsamples.ogp.me%2F390580850990722
curl -X POST \
     -d "song=http%3A%2F%2Fsamples.ogp.me%2F461258627226537" \
     -d "radio_station=http%3A%2F%2Fsamples.ogp.me%2F461258533893213" \
     -d "album=http%3A%2F%2Fsamples.ogp.me%2F461258347226565" \
     -d "playlist=http%3A%2F%2Fsamples.ogp.me%2F461258467226553" \
     -d "musician=http%3A%2F%2Fsamples.ogp.me%2F390580850990722" \
        https://graph.facebook.com/v3.0/me/music.listens

Request

NameTypeDescription
FIELDS
albumReferenceAn object representing an album
musicianReferenceAn object representing a musician
pausedBooleanWhether the audio is paused or not
playlistReferenceAn object representing a playlist
radio_stationReferenceAn object representing a radio station
songReferenceAn object representing a song
via_userIntegerThe ID of anyone whom the user discovered this audio from
INHERITED FIELDS
created_timeDateTimeThe time that the action was created
end_timeDateTimeThe time that the user ended
expires_inIntegerThe amount of time from the publish_time that the action will expire
fb:explicitly_sharedBooleanThe user is explicitly sharing this action
messageStringA message attached to this action
no_feed_storyBooleanDo not post this action to the feed
placePlaceThe place that the action took place
refStringA <50 character string identifier for tracking and insights
start_timeDateTimeThe time that the user started
tagsArray<Profile>Any other users that performed the action

Response

NameTypeDescription
idListenA Listen action id
Read
/* make the API call */
FB.api(
    "/me/music.listens",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/me/music.listens"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/me/music.listens",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->get(
    '/me/music.listens',
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
GET /v3.0/me/music.listens HTTP/1.1
Host: graph.facebook.com
curl https://graph.facebook.com/v3.0/me/music.listens

Request

NameTypeDescription
idListenA Listen action id

Response

NameTypeDescription
FIELDS
albumReferenceAn object representing an album
musicianReferenceAn object representing a musician
pausedBooleanWhether the audio is paused or not
playlistReferenceAn object representing a playlist
radio_stationReferenceAn object representing a radio station
songReferenceAn object representing a song
via_userIntegerThe ID of anyone whom the user discovered this audio from
INHERITED FIELDS
end_timeDateTimeThe time that the user ended
imageArray<ActionImage>
image:urlURL
image:secure_urlURL
image:typeString
image:widthInteger
image:heightInteger
image:altString
image:user_generatedBoolean
messageStringA message attached to this action
no_feed_storyBooleanDo not post this action to the feed
placePlaceThe place that the action took place
publish_timeDateTimeThe time that the action was published
refStringA <50 character string identifier for tracking and insights
start_timeDateTimeThe time that the user started
tagsArray<Profile>Any other users that performed the action
Update
/* make the API call */
FB.api(
    "/id_from_create_call",
    "POST",
    {
        "song": "http:\/\/samples.ogp.me\/461258627226537",
        "radio_station": "http:\/\/samples.ogp.me\/461258533893213",
        "album": "http:\/\/samples.ogp.me\/461258347226565",
        "playlist": "http:\/\/samples.ogp.me\/461258467226553",
        "musician": "http:\/\/samples.ogp.me\/390580850990722"
    },
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
NSDictionary *params = @{
  @"song": @"http://samples.ogp.me/461258627226537",
  @"radio_station": @"http://samples.ogp.me/461258533893213",
  @"album": @"http://samples.ogp.me/461258347226565",
  @"playlist": @"http://samples.ogp.me/461258467226553",
  @"musician": @"http://samples.ogp.me/390580850990722",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/id_from_create_call"
                                      parameters:params
                                      HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
Bundle params = new Bundle();
params.putString("song", "http://samples.ogp.me/461258627226537");
params.putString("radio_station", "http://samples.ogp.me/461258533893213");
params.putString("album", "http://samples.ogp.me/461258347226565");
params.putString("playlist", "http://samples.ogp.me/461258467226553");
params.putString("musician", "http://samples.ogp.me/390580850990722");
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/id_from_create_call",
    params,
    HttpMethod.POST,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->post(
    '/id_from_create_call',
    array (
      'song' => 'http://samples.ogp.me/461258627226537',
      'radio_station' => 'http://samples.ogp.me/461258533893213',
      'album' => 'http://samples.ogp.me/461258347226565',
      'playlist' => 'http://samples.ogp.me/461258467226553',
      'musician' => 'http://samples.ogp.me/390580850990722',
    ),
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
POST /v3.0/id_from_create_call HTTP/1.1
Host: graph.facebook.com

song=http%3A%2F%2Fsamples.ogp.me%2F461258627226537&radio_station=http%3A%2F%2Fsamples.ogp.me%2F461258533893213&album=http%3A%2F%2Fsamples.ogp.me%2F461258347226565&playlist=http%3A%2F%2Fsamples.ogp.me%2F461258467226553&musician=http%3A%2F%2Fsamples.ogp.me%2F390580850990722
curl -X POST \
     -d "song=http%3A%2F%2Fsamples.ogp.me%2F461258627226537" \
     -d "radio_station=http%3A%2F%2Fsamples.ogp.me%2F461258533893213" \
     -d "album=http%3A%2F%2Fsamples.ogp.me%2F461258347226565" \
     -d "playlist=http%3A%2F%2Fsamples.ogp.me%2F461258467226553" \
     -d "musician=http%3A%2F%2Fsamples.ogp.me%2F390580850990722" \
        https://graph.facebook.com/v3.0/id_from_create_call

Request

NameTypeDescription
FIELDS
albumReferenceAn object representing an album
musicianReferenceAn object representing a musician
pausedBooleanWhether the audio is paused or not
playlistReferenceAn object representing a playlist
radio_stationReferenceAn object representing a radio station
songReferenceAn object representing a song
via_userIntegerThe ID of anyone whom the user discovered this audio from
INHERITED FIELDS
end_timeDateTimeThe time that the user ended
expires_inIntegerThe amount of time from the publish_time that the action will expire
messageStringA message attached to this action
placePlaceThe place that the action took place
refStringA <50 character string identifier for tracking and insights
tagsArray<Profile>Any other users that performed the action

Response

NameTypeDescription
idListenA Listen action id
Delete
/* make the API call */
FB.api(
    "/id_from_create_call",
    "DELETE",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/id_from_create_call"
                                      parameters:params
                                      HTTPMethod:@"DELETE"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/id_from_create_call",
    null,
    HttpMethod.DELETE,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->delete(
    '/id_from_create_call',
    array (),
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
DELETE /v3.0/id_from_create_call HTTP/1.1
Host: graph.facebook.com
curl -X DELETE \
        https://graph.facebook.com/v3.0/id_from_create_call

Request

NameTypeDescription
idListenA Listen action id

Response

If successful, returns boolean true
true
If not successful, returns an error JSON object
{
  "error":
  {
    "message":ERROR_MESSAGE,
    "type":ERROR_TYPE,
    "code":ERROR_CODE
  }
}