Hey,
i developing a web application in which i using the pipedrive api.
Now i want to update data of a person. I already tryed it in postman and all works well. But if i do the same in my web application i’ve got the response {“status”:false,“error”:“Unknown method .”}.
I can’t find any mistakes.
This is my code:
public function updatePerson( $id, $data ){
$url = $this->end_point . "/persons/$id?api_token=" . $this->token;
$key = key($data);
$body = [
$key => $data[$key]
];
$args = [
'body' => $body,
'timeout' => '5',
'redirection' => '5',
'httpversion' => '1.0',
'blocking' => true,
'headers' => array(),
'cookies' => array()
];
$result = wp_remote_retrieve_body( wp_remote_post( $url, $args ) );
var_dump($result);
}
Do anyone have an idea to solve it?