Pega and Whatsapp Integration

Image
 Pega and Whatsapp Integration Following the procedure from  Official Whatsapp Cloud API 1. Set up Developer Assets and Platform Access The  WhatsApp Cloud API  and  WhatsApp Business Management API  are part of Meta’s Graph API, so you need to set up a Meta developer account and a Meta developer app. To set that up: Register as a Meta Developer  Enable two-factor authentication for your account  Create a Meta App : Go to  developers.facebook.com  >  My Apps  >  Create App . Select the "Business" type and follow the prompts on your screen. Click the app you want to connect to WhatsApp from the App Dashboard. Click Set up when you locate the "WhatsApp" product by scrolling down. Following that, you will have the choice to choose an existing Business Manager (if you have one) or, if you prefer, have one created for you automatically through the onboarding process (you can customize your business later, if needed). Make...

Spotify Playlist Creation From Pega

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"




Step 3 : Click "Edit Settings and add your redirect URI:  http://localhost:PORTNUMBER/prweb/PRRestService/oauth2/v1/redirect.
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!!


























    














Comments

  1. Hi Sam,
    When I run request JSON in REST response, I got an error "Error parsing JSON". Can you help me!!

    ReplyDelete
  2. This post is very simple to read and appreciate without leaving any details out. Great work !best call center solution for business

    ReplyDelete

Post a Comment

Popular posts from this blog

Pega and Whatsapp Integration

Razorpay and Pega Integration

How to have a Voice OTP feature in Pega