gohighlevel-php-sdk

Sub-Account (Formerly Location) Api

Sub-Account (Formerly Location)

$location = GoHighLevel::client($access_token,'2021-07-28')->location();

Create Sub-Account (Formerly Location)


$client = GoHighLevel::client($access_token,'2021-07-28');

 $location = $client->location()->create([
            'name' => $user->name,
            'companyId' => $companyId,
            'email' => $user->email,
        ]);

Get Sub-Account (Formerly Location)

$client = GoHighLevel::client($access_token,'2021-07-28');

$location = $client->location()->get($locationId);

Update Sub-Account (Formerly Location)

$client = GoHighLevel::client($access_token,'2021-07-28');
$client->location()->update($locationId, [
    // body
]);

Delete Sub-Account (Formerly Location)

$client = GoHighLevel::client($access_token,'2021-07-28');
$client->location()->delete($locationId, [
    // deleteTwilioAccount => true
])

Tags


    $tag = $location->tag();

Get Tags


    $response = $tag->list($locationId);

Create Tag


    $response = $tag->create($locationId, [
        //parameters
    ]);

Get Tag By Id


    $response = $tag->get($locationId, $tagId);

Update Tag By Id


    $response = $tag->update($locationId, $tagId, [
        
    ]);

Delete Tag


    $response = $tag->delete($locationId, $tagId);

Custom Field


    $customField = $location->customField();

Get Custom Fields


    $response = $customField->list($locationId, [
        //parameters
    ]);

Create Custom Field


    $response = $customField->create($locationId, $name, $dataType, [
        //parameters
    ]);

Get Custom Field


    $response = $customField->create($locationId, $name, $dataType, [
        //parameters
    ]);

Update Custom Field


    $response = $customField->update($locationId, $id, [
        //parameters
    ]);

Delete Custom Field


    $response = $customField->delete($locationId, $id);

Upload File to a Custom Field


    $response = $customField->upload($locationId, [

    ]);

Custom Value


    $customValue = $location->customValue();

Get Custom Values


    $response = $customValue->list($locationId);

Create Custom Value


    $response = $customValue->create($locationId,[
        //parameters
    ]);

Get Custom Value


    $response = $customValue->get($locationId, $id);

Update Custom Value


    $response = $customValue->update($locationId, $id, [
        //parameters
    ]);

Delete Custom Value


    $response = $customValue->delete($locationId, $id);

Template


    $template = $location->template();

Get all templates


    $response = $template->list($locationId, $originId, [
        //parameters
    ]);

Delete Template


    $response = $template->delete($locationId, $id);

    $search = $location->search();

Search Locations


    $response = $template->search([
        //parameters
    ]);

    //or
    $response = $template->query([
        //query parameters
    ]);

Task Search Filter


    $response = $template->tasks($locationId, [
        //query parameters
    ]);