PHP code example of matheushack / rd-station

1. Go to this page and download the library: Download matheushack/rd-station library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

matheushack / rd-station example snippets



MatheusHack\RdStation\Contact;
use MatheusHack\RdStation\Requests\ContactRequest;

$request = (new ContactRequest())
    ->setEmail('[email protected]');

$response = (new Contact())
    ->create($request);


MatheusHack\RdStation\Contact;
use MatheusHack\RdStation\Requests\ContactRequest;

$request = (new ContactRequest())
    ->setEmail('[email protected]')
    ->setName('Example')
    ->setJobTitle('Developer')
    ->setBirthDate('1992-12-14')
    ->setBio('Bio example')
    ->setWebsite('example.com.br')
    ->setCity('São Paulo')
    ->setState('SP')
    ->setCountry('Brasil')
    ->setTags([
        'teste',
    ]);

$response = (new Contact())
    ->update($request);


MatheusHack\RdStation\Contact;
use MatheusHack\RdStation\Requests\ContactRequest;

$request = (new ContactRequest())
    ->setEmail('[email protected]');

$response = (new Contact())->find($request);


MatheusHack\RdStation\Conversion;
use MatheusHack\RdStation\Requests\ConversionRequest;
use MatheusHack\RdStation\Requests\ConversionPayloadRequest;

$payload = (new ConversionPayloadRequest())
    ->setConversionIdentifler('Conversão exemplo')
    ->setEmail('[email protected]');

$request = (new ConversionRequest())
    ->setEventType('CONVERSION')
    ->setEventFamily('CDP')
    ->setPayload($payload);

$response = (new Conversion())
    ->create($request);