Listen Action

Currently we are not accepting any new submissions for the Listen action.

For developers building music apps, we have a common Open Graph music.listens action. This action can only refer to a music object type such as a song, album, playlist, musician (profile), or radio_station. As a convenience, all of these music object types are automatically added to the App Dashboard when you register the listen action for your app.

This document covers the following topics:

Code Samples

You can find platform-specific code samples on how to create, read, update, or delete a music.listens action in the API Reference Guide.

Guidelines

The moment someone starts listening to a song, your app should publish a music.listens action. If someone stops or pauses the music after less than 15 seconds of a song, your app should delete the action:

DELETE https://graph.facebook.com/[listen id]

In this case if person clicks play again, you should publish a new action with the end_time set to when the song is expected to end (which should be earlier than the song duration plus the current time, since the song was started at an offset).

If someone stops or pauses the music after more than 15 seconds of a song, but less than the complete song, the action should be updated to reflect they have stopped listening by setting end_time to the time when the song was paused (the current time), and the paused attribute to true.

POST https://graph.facebook.com/[listen id]?end_time=2013-02-20T13:25:14

In this case if the person clicks play again, you should update the action instance so that the end_time accurately reflects when the song is expected to end, and so that paused is set to false. However, if they have waited longer than the total song length before clicking play again, you should instead delete the old action and create a new one, since we consider this a fresh new listen.