SevenShores\Hubspot\Resources\Forms::getFieldByName PHP Method

getFieldByName() public method

Get a single field from a form.
See also: http://developers.hubspot.com/docs/methods/forms/v2/get_field
public getFieldByName ( string $form_guid, string $name ) : Response
$form_guid string
$name string
return SevenShores\Hubspot\Http\Response
    function getFieldByName($form_guid, $name)
    {
        $endpoint = "https://api.hubapi.com/forms/v2/fields/{$form_guid}/{$name}";
        return $this->client->request('get', $endpoint);
    }

Usage Example

Example #1
0
 /** @test */
 public function getFieldByName()
 {
     $form = $this->createForm();
     $response = $this->forms->getFieldByName($form->guid, 'firstname');
     $this->assertEquals(200, $response->getStatusCode());
 }