...
...
OverviewThe following operations allow you to work with User profiles in Spotify. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with User profiles, see Sample configuration.
Anchor |
---|
| OperationDetails |
---|
| OperationDetails |
---|
|
Operation detailsThis section provides the details on each operation related to User profiles.
Get profile of a UserTo get the public profile information of a Spotify user, use spotify.getProfileOfAUser operation
Code Block |
---|
language | xml |
---|
title | getProfileOfAUser |
---|
|
<spotify.getProfileOfAUser>
<userId>keerthu</userId>
</spotify.getProfileOfAUser> |
Properties
userId: The user’s Spotify Id.
Sample request
Following is a sample REST/JSON request that can be handled by the getProfileOfAUser
operation.
Code Block |
---|
title | Sample Request for getProfileOfAUser |
---|
|
{
"userId":"keerthu"
} |
Anchor |
---|
| getProfileOfCurrentUser |
---|
| getProfileOfCurrentUser |
---|
|
Get current User’s profileTo get the detailed profile information of current Spotify user including username, use spotify.getProfileOfCurrentUser operation.
Code Block |
---|
language | xml |
---|
title | getProfileOfCurrentUser |
---|
|
<spotify.getProfileOfCurrentUser/> |
Anchor |
---|
| sampleRequest |
---|
| sampleRequest |
---|
|
Sample requestFollowing is a sample REST/JSON request that can be handled by the getProfileOfCurrentUser
operation.
Code Block |
---|
title | Sample Request for getProfileOfCurrentUser |
---|
|
{
"clientId":"f043fec58a584539ba94c0c588136712",
"clientSecret":"b421eecdfe184be29b1d297505befcac",
"grantType":"refresh_token",
"refreshToken":"AQCQPj6__vnciBWMpS1lJ_V_oefCZUy2V7z_Ha7WBoZZTKRsVPgDTtecOMN5rxXs9mvtencluvX3m_RNCsTqTTJtwZCmcrte_1Ar_SzXDug-AtdbSiZXMObPa8Kw0-8tE8c"
} |
Anchor |
---|
| sampleconfiguration |
---|
| sampleconfiguration |
---|
|
Sample configurationFollowing is a sample proxy service that illustrates how to connect to Spotify with the init and getAccessTokenFromRefreshToken
operations to use the getProfileOfCurrentUser
operation. The sample request for this proxy can be found in getProfileOfCurrentUser sample request.
Code Block |
---|
|
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="spotify_getProfileOfCurrentUser"
transports="https,http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<spotify.init/>
<property name="clientId" expression="json-eval($.clientId)"/>
<property name="clientSecret" expression="json-eval($.clientSecret)"/>
<property name="grantType" expression="json-eval($.grantType)"/>
<property name="refreshToken" expression="json-eval($.refreshToken)"/>
<spotify.getAccessTokenFromRefreshToken>
<clientId>{$ctx:clientId}</clientId>
<clientSecret>{$ctx:clientSecret}</clientSecret>
<grantType>{$ctx:grantType}</grantType>
<refreshToken>{$ctx:refreshToken}</refreshToken>
</spotify.getAccessTokenFromRefreshToken>
<spotify.getProfileOfCurrentUser/>
<respond/>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
<description/>
</proxy> |