Lesson3: Profile Update - Adobe-Marketing-Cloud/target-iot-lab GitHub Wiki
Objective
In the previous lesson, we were able to update the active state for a give Visitor ID using the SmartFridge Display. In this lesson you will learn how to update Visitor ID information via API.
You will use each of the API-based methods to update profiles.
Exercise 1: View the profiles using our Profile Fetch API
In this exercise, you will use the API to pass a Visitor ID (labuserXX-visitor1) to Target. You will receive a response containing the activity state associated with that Visitor ID.
In our last lesson we set the activity state for labuserXX-visitor1 to "marathoner" using the SmartFridge Display.
- Step 1: Select the 1st API in the collection: "01. View Profile by thirdPartyId". Change the value labuseridXX-visitor1 in the API URL to the value you entered on the SmartFridge Display for the Visitor ID (example: labuserid01-visitor1). Click "Send".
The response should reflect the activity state that you set for the user in the SmartFridge Display, "marathoner".
Note that there is a delay of several minutes between when you update the activity state in the SmartFridge Display and when it gets updated in the system. If you change the activity state and then use the Profile Fetch API to check it, the update will take several minutes to reflect. If you update the activity state via API, it will update immediately in the system.
Exercise 2: Update the profile using Profile Update API
Next, let's update the profile for that Visitor ID with a new activity state using the API.
-
Step 1: Open the postman call "02. Update profile by thirdPartyID".
-
Step 2: Go to the URL. Update the value for the query parameter "profile.activeState" to pass in a new value, fitnessfreak. Do this by changing the text after "profile.activeState=" to fitnessfreak.
- Step 3: Now go back to the first call in the collection, "01.View profile by thirdPartyID". Hit send again and you should see the response now reflect the _fitnessfreak _activity state within a couple of seconds.
- Step 4: Next, go back to the SmartFridge Display. Hit "OK' again and you should see the image on left change. This is because we just updated the activity state to fitness freak.
If this doesn't work, clear cookies on browser, refresh the kiosk web page, and re-enter your user name and user Id. Then hit send again.
Conclusion
In this lesson you learnt how Target allows you to update the profiles within and out of the context of mbox calls. We will be using this technique as we build out the wellness app even further.