Spotify Playlist Creation From Pega
Step 1 : Go to https://developer.spotify.com
Step 2 : Log in with your spotify account and click "Create App"
Click Save.
Step 5 : We need the spotify account user ID. To get your user ID go to
https://www.spotify.com/ . Go to Profile -> Account
Step 6 : Note down the User ID(User name).
#------------------------END OF SPOTIFY CONFIGURATION------------------------------#
PEGA CONFIGURATION
Step 1 : Create Authentication profile. Go to Records -> Security -> Authentication profile -> Create new.
Step 2 : Create with the following configurations.
Authorization End point : https://accounts.spotify.com/authorize
Token end point : https://accounts.spotify.com/api/token
Scope : playlist-modify-public playlist-modify-private
Use Client ID and Client secret from the spotify app
Step 3 : Create a Rest Integration : Configure -> Integrations->Connectors ->Create Rest Integration.
End point URL : https://api.spotify.com/v1/users/{user_id}/playlists
Resource parameter : user_id
Add Authentication use your authentication profile
Step 4 : Click on Connect to authorize pega with spotify and to request access tokens
Step 5 : Now it should show as "disconnect" which means successfully connected
Step 6 : Add a rest response with "Post" as method and in the user_id parameter copy paste your user id that you got from spotify.com and the nadd the request json in the body.
{
"name": "New Playlist",
"description": "New playlist description",
"public": false
}
Step 7 : You would've already created a playlist by now!! Check your spotify account!!
with the name New Playlist and description as new playlist description
Step 8 : Click submit and start generating
Step 9 : Open the datapage that is created, you can see the datapage class in the generation step "data layer details"
Step 10 : Input your userID directly in the parameter tab
Step 11 : In the request DT delete .defaultResponse_GET
.name = title of your playlist
.description = description of your playlist
You can input these fields with pyWorkPage or parameter as well.
Step 12 : Save and run the datapage.
Playlist is created!!
Do Comment and Share your thoughts!!
Hi Sam,
ReplyDeleteWhen I run request JSON in REST response, I got an error "Error parsing JSON". Can you help me!!
This post is very simple to read and appreciate without leaving any details out. Great work !best call center solution for business
ReplyDelete