contact us (+48) 12 446 66 66

Helmdeck API

accesstoken with POST :

https://HELMDECK_NAME.helmdeck.com/oauth/token?grant_type=password&client_id=MY_ID&client_secret=MY_SECRET&password=HELMDECK_PASSWORD&username=HELMDECK_USERNAME

so basicallly you need:

  • HELMDECK_NAME
  • MY_ID
  • MY_SECRET
  • HELMDECK_USERNAME
  • HELMDECK_PASSWORD

POST:

https://HELMDECK_NAME.helmdeck.com/services/restapi/json/Lead/create

authorization before http header “Authorization” “Bearer ACCESSTOKEN”

php example with httpful.phar library

authorization.php
<$response = \Httpful\Request::post("https://HELMDECK_NAME.helmdeck.com/oauth/token?grant_type=password&client_id=" . MY_ID . "&client_secret=" . MY_SECRET . "&password=" . HELMDECK_PASSWORD. "&username=" . HELMDECK_USERNAME)
   ->send();
 
$access_token = $response->body->access_token;>
response.php
<$access_token = $response->body->access_token;
$response = \Httpful\Request::post("https://HELMDECK_NAME.helmdeck.com/services/restapi/json/Lead/create")
    ->body(http_build_query(array(
        'name' => $_POST['name'],
        'surname' => $_POST['surname'],
        'companyName' => $_POST['companyName'],
        'sourceId' => DICTIONARY_ID,
        'mainPhoneNumber.suffix' => $_POST['phone'],
        'mainPhoneNumber.prefix' => '1',
    )))
    ->addHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8')
    ->addHeader('Authorization', 'Bearer ' . $access_token)
    ->send();
 
$leadId = $response->body->id;>