hubspotex v0.0.6 Hubspot.Forms

Summary

Functions

Return all forms that have been created in the portal

Create a new form

Delete an existing form

Return a single form based on the unique ID of that form

Get a single field from a form

Get all fields from a form

Submit data to a form

Update an existing form

Functions

all()

Return all forms that have been created in the portal.

see: http://developers.hubspot.com/docs/methods/forms/v2/get_forms

Example

iex> Hubspot.Forms.all()
%Hubspot.HTTP.Request{endpoint: "/forms/v2/forms",
  method: :get, body: "", query: []}
create(form)

Create a new form.

see: http://developers.hubspot.com/docs/methods/forms/v2/create_form

Example

iex> Hubspot.Forms.create([])
%Hubspot.HTTP.Request{endpoint: "/forms/v2/forms",
  method: :post, body: [], query: []}
delete(form_guid)

Delete an existing form.

see: http://developers.hubspot.com/docs/methods/forms/v2/delete_form

Example

iex> Hubspot.Forms.delete("1234-abcd")
%Hubspot.HTTP.Request{endpoint: "/forms/v2/forms/1234-abcd",
  method: :delete, body: "", query: []}
getById(form_guid)

Return a single form based on the unique ID of that form.

see: http://developers.hubspot.com/docs/methods/forms/v2/get_form

Example

iex> Hubspot.Forms.getById("1234-abcd")
%Hubspot.HTTP.Request{endpoint: "/forms/v2/forms/1234-abcd",
  method: :get, body: "", query: []}
getFieldByName(form_guid, name)

Get a single field from a form.

see: http://developers.hubspot.com/docs/methods/forms/v2/get_field

Example

iex> Hubspot.Forms.getFieldByName("1234-abcd", "some_field")
%Hubspot.HTTP.Request{endpoint: "/forms/v2/fields/1234-abcd/some_field",
  method: :get, body: "", query: []}
getFields(form_guid)

Get all fields from a form.

see: http://developers.hubspot.com/docs/methods/forms/v2/get_fields

Example

iex> Hubspot.Forms.getFields("1234-abcd")
%Hubspot.HTTP.Request{endpoint: "/forms/v2/fields/1234-abcd",
  method: :get, body: "", query: []}
submit(portal_id, form_guid, form)

Submit data to a form.

see: http://developers.hubspot.com/docs/methods/forms/submit_form

Send form submission data to HubSpot. Form submissions from external sources can be made to any registered HubSpot form. You can see a list of forms on your portal by going to the Contacts > Forms page

Example

iex> Hubspot.Forms.submit(1234, "1234-abcd", [])
%Hubspot.HTTP.Request{endpoint: "https://forms.hubspot.com/uploads/form/v2/1234/1234-abcd",
  method: :post, body: [], query: []}
update(form_guid, form)

Update an existing form.

see: http://developers.hubspot.com/docs/methods/forms/v2/update_form

Example

iex> Hubspot.Forms.update("1234-abcd", [])
%Hubspot.HTTP.Request{endpoint: "/forms/v2/forms/1234-abcd",
  method: :post, body: [], query: []}