Hello everyone! im a game developer and i am making a game for a client that uses klaviyo for subscriptions. now i have handled api requests through unity before but i cannot link it to my account here to see if it works.
Here is my code through Unity that calls a Post request
private IEnumerator SendData()
{
WWWForm form = new WWWForm();
form.AddField("email", emailField.text); // this is the email entered in the UI of the game
form.AddField("api_key", "my_api_key_here");
UnityWebRequest www = UnityWebRequest.Post("https://a.klaviyo.com/api/v2/list/{LIST_ID}/subscribe", form);
yield return www.SendWebRequest();
if (www.isNetworkError || www.isHttpError)
{
Debug.Log(www.error);
}
else
{
Debug.Log("Registered");
}
Debug.Log(emailField.text);
}
}
like this i get a 404 and i dont know if im doing something wrong with the url. to be honest i have tried it with mailchimp since this is what i have used before and it works ok. any help would be appreciated thanks!