Question

Send PHP array with PUT webhook

  • 20 May 2022
  • 1 reply
  • 202 views

Hello,

I´m currently stuck with an automation for my E-Mail Marketing service. I want to automatically update custom fields and their documentation uses PHP scripts as an example, for which I don´t have any experience.

 

The link to the documentation: https://support.klicktipp.com/article/389-application-programming-interface-api#api-subscriber-update

I can update the email and the phone without any problems, but I don´t know how to write the webhook, so the custom fields in the array are updatet.

Can anyone help me with that please?

 


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Userlevel 7
Badge +12

Hi @m-neowake 

Their api is cookie (session token) authorization meaning you will first have to exchange your username and password for a token to authenticate subsequent requests. You can read about that here: https://support.klicktipp.com/article/393-api-function-overview 

Since they’ve written a php wrapper around their api you can’t be certain how they want you to send the data because they could be manipulating it in their function however they want before making a call but there are only a handful of ways to send the data. I’d first try it as url params and if that doesn’t work send it in the body of your request. 

PUT https://api.klicktipp.com/subscriber/<subscriberid>
-params: 
fields(i.e ‘fieldFirstName’,’fieldLastName’), newemail, newsmsnumber,

based off of this github: https://github.com/wp-plugins/woo-to-klick-tipp-tagged-email-marketing/blob/master/klicktipp.api.php It looks like the params are url encoded. i.e https://api.klicktipp.com/subscriber/<subscriberid>?fieldFirstName={FIRSTNAME}