Hi Developer Group!
Weβre finally back with a special installment of the ($500 prize) Developer Challenge!Β ππ°β
Β
This month, weβre doing an API Scavenger Hunt,Β which will teach you to makeΒ API calls to a Klaviyo testΒ account Iβve created specifically for this challenge.
Β
After following all of the clues and retrieving the final βcode wordβ, youβll submit your answer by adding the finalΒ code wordΒ as a custom property to your profile in the test account!
Β
Another fun part of this challenge is that everyone can start on their own timeΒ - itβs still a race (fastest time wins),Β but everyoneβs timer will start individually whenΒ they choose to submit the first API call, and will end when they submit their last API call.
Β
Therefore, you can start the challenge on the first day, or the last day, and you donβt have to worry about someone beating you to it. Everyone has a fair shot at getting the fastest time!
Β
Contest open now (Dec. 18) toΒ FridayΒ Dec.Β 29, 2023 at 11:59 pm EST!
Β
ATTENTION
Contest is open to legal residents of the contiguousΒ United States,Β CanadaΒ (with the exception of Quebec),Β Australia,Β India (excluding the State of Tamilnadu), and theΒ United Kingdom
Β
Β

Β
CHALLENGE INSTRUCTIONS:
This monthβs Challenge is an APIΒ Scavenger Hunt.
Β
Iβve created a set ofΒ private API keys for my test account that youβll use to make different API calls. Each API keyβs scope is limited to the permissions required for each individual step of the scavenger hunt.Β
Β
- Examples use Postman, but you may use the testing platform of your choice
Β

Β Β
- Β Youβll start by creating the start_timerΒ event, using the Create EventΒ endpoint.
Since I can view the exact time each API call is made using our new API logs tool, we will use this event as your βstarting gunβ for this challenge:
Β-
Call the event, βstart_timerβ (Case sensitive):

Β
-
Β Make sure to clear theΒ timeΒ value, so that the starting_time value is defaulted to when the request is received on my end:

Β
-
Make sure to clear the _kxΒ value as well:

Β
-
VERY IMPORTANTΒ Make sure to include your email address (and name and other information if wanted, but not required) in the attributes object, and clear other identifiers like phone number and id:

Β
-
A new Event requires a property object, which you can leave as the default newKey:newValue
Β -
Finally, you may clear any other unused values and authenticate with the assigned API key, which is as follows:
pk_0efdaca00cde418f2c7344097b602edfc7
Β
-
Β
This API call will create a profile for you in my test account, and will also start your individual timer.
Β

Β
- Iβve hidden the next clue in your profile as a custom property...can you find it?Β
Youβll need this private API Key with profile access:Β
pk_a123d81fa0389aebb3ff69767adb87f17b
ATTENTION:Β You know your email, but not your Profile ID...that means youβll have to use Get Profiles.Β You must filter by your email address using the filter:Β equals(email,β[email address]β)
Β
If I see that you used Get Profiles WITHOUT FILTERING,Β youβll be DISQUALIFIED! (since that means youβll see othersβ clues!)
Hint:Β Take note of your Profile ID!
Β - Iβm guessing youβve found the clue, which means youβre wondering what to do with it...In order to find the first letter of the finalΒ code word, youβll have to use the clue with our new Get Image API:
Get Image
PrivateΒ key:Β pk_2d9e9bb1baa1eddc261995a1ce92a6e4b6
Β
Β

Β
Clue #2 is expensive, so youβll have to use my 100% OFF couponβ¦
Β
- See if you can find my 100% OFF Coupon #2 code using our new Get Coupons API:
Get Coupons
Private key:Β pk_79d6931e4d9a18142443e5e97eaa8519f7
Β - Once youβve found the coupon code, youβll need to use itΒ with our Get Image API again, and youβll receive the second letter of the final code word!
Get Image
PrivateΒ key:Β pk_2d9e9bb1baa1eddc261995a1ce92a6e4b6
Β

Β
If you want Clue #3, youβll have to ask for it...by creating a new Event!
Β
- Create an event via our Create Event API called βcluepleaseβ, using your email as the profile identifier. Make sure to follow all the same structure as Step 1, to ensure Klaviyo recognizes your event immediately (especially clearing the time value)!
Private key:Β pk_0efdaca00cde418f2c7344097b602edfc7
ββββ - If youβve created the event successfully and named it cluepleaseΒ like you were supposed to, your profile has now been marked with a new property called SecondClue!
If you need help gettingΒ the property, Iβd take another look at Step #2β¦
Hint: Private key:Β pk_a123d81fa0389aebb3ff69767adb87f17b
Β - Once you have the property, Iβm guessing you know the next step...use it inΒ Get Images for the third letter of the final code word!
Get Image
PrivateΒ key:Β pk_2d9e9bb1baa1eddc261995a1ce92a6e4b6
Β

Β
I donβt want to spoil the finalΒ code wordΒ by revealing how many letters remain, so Iβm going to hide the last [x amount of] clues all in the same hiding place.
For the final clues, youβll have to use the Get AccountΒ API, with my Account ID which is VCjjW5.
Β
βBut whatβs the private key youβve created for Read Account access?βΒ ββββββ
Well, in order to keep you from jumping ahead, I actually snuck in another property value in your profile during the last step, calledΒ Step 5. The value of that property is the PrivateΒ Key with Read Account access!
Β
In other words: To get the Private Key you need to make the Get Account call, youβll have to check your profile properties for a propertyΒ called βStep 5β! Read through the previous steps if you need help making the required Get Profile(s)Β call!Β
Β
The final clue(s) are hidden in the response of a correct Get Account call. What are the final clues?Β You guessed it - they will be the Image IDs of the final letters of the code word!
Just to remind you:
Get Image
PrivateΒ key:Β pk_2d9e9bb1baa1eddc261995a1ce92a6e4b6ββββββ
Β

Β
Congratulations! Youβve made it so far, and if youβre reading this it means youβve discovered the final code word!
Β
To submit your entry and stop your timer, add the final code wordΒ as a custom property called βcodewordβ to your profile using Update Profile:
Private key:Β pk_822c4b325eb25cca2361db45a0dbeb89f5
Youβll need your Profile ID, which by now I hope youβve discovered in the response of one of the above steps!
βββ
Β
Thanks for playing!!!
Β
Please feel free to reach out to me via email (brian.turcotte@klaviyo.com) with any questions, and Iβll announce the winner afterΒ the contest closes on FridayΒ December 29, 2023 at 11:59 pm EST!
Best,
Brian