Integrations

Scripting Custom Scripts

Forms has an OAuth Integration service to help you call external APIs with custom scripts. Your users can log in with OAuth accounts for services we've integrated with from their Settings page, and you can programmatically call API actions. We'll store their sensitive OAuth details, and provide an access token to your API calls automatically. Note, this means you do not have to pass an access token with your requests, we will add it dynamically and format it correctly. We're currently integrated with Salesforce and the Force.com platform, and you can email us at support@sonadier.com to request another service.

delete(path, params = {}, request_params = {})

This method is available to server-side scripts.

Makes a DELETE request to the given path. The path will be appended to the base URL for the integration. A preceding slash is optional. The optional params parameter will be sent as parameters with the request. The optional request_params parameter will be applied to the ajax request options. An OAuth access token will be automatically added to the request, formatted properly for the API.

Integrations.salesforce.delete("/services/data/v35.0").done(function(response) {
  console.log(response)
})

exists()

This method is available to server-side scripts.

Makes a request to check if the user has set up the specific integration. Returns a deferred object which will resolve or reject with the status of the integration. Unlike this method, the require method will both check if the integration is set up and require the user to set it up before resolving, so you can freely use integration requests in a require.done() block.

Integrations.salesforce.exists().done(function() {
  console.log("This integration exists.")
}).fail(function() {
  console.log("This integration does not exist.")
})

get(path, params = {}, request_params = {})

This method is available to server-side scripts.

Makes a GET request to the given path. The path will be appended to the base URL for the integration. A preceding slash is optional. The optional params parameter will be sent as parameters with the request. The optional request_params parameter will be applied to the ajax request options. An OAuth access token will be automatically added to the request, formatted properly for the API.

Integrations.salesforce.get("/services/data/v35.0").done(function(response) {
  console.log(response)
})

master.delete(path, params = {}, request_params = {})

This method is available to server-side scripts.

Makes a DELETE request to the given path with the master account for the integration. Master accounts allow facilities to use a single account for API access to the integration, rather than having users authenticate individually. The path will be appended to the base URL for the integration. A preceding slash is optional. The optional params parameter will be sent as parameters with the request. The optional request_params parameter will be applied to the ajax request options. An OAuth access token will be automatically added to the request, formatted properly for the API.

Integrations.salesforce.master.delete("/services/data/v35.0").done(function(response) {
  console.log(response)
})

master.get(path, params = {}, request_params = {})

This method is available to server-side scripts.

Makes a GET request to the given path with the master account for the integration. Master accounts allow facilities to use a single account for API access to the integration, rather than having users authenticate individually. The path will be appended to the base URL for the integration. A preceding slash is optional. The optional params parameter will be sent as parameters with the request. The optional request_params parameter will be applied to the ajax request options. An OAuth access token will be automatically added to the request, formatted properly for the API.

Integrations.salesforce.master.patch("/services/data/v35.0").done(function(response) {
  console.log(response)
})

master.options(path, params = {}, request_params = {})

This method is available to server-side scripts.

Makes an OPTIONS request to the given path with the master account for the integration. Master accounts allow facilities to use a single account for API access to the integration, rather than having users authenticate individually. The path will be appended to the base URL for the integration. A preceding slash is optional. The optional params parameter will be sent as parameters with the request. The optional request_params parameter will be applied to the ajax request options. An OAuth access token will be automatically added to the request, formatted properly for the API.

Integrations.salesforce.master.options("/services/data/v35.0").done(function(response) {
  console.log(response)
})

master.patch(path, params = {}, request_params = {})

This method is available to server-side scripts.

Makes a PATCH request to the given path with the master account for the integration. Master accounts allow facilities to use a single account for API access to the integration, rather than having users authenticate individually. The path will be appended to the base URL for the integration. A preceding slash is optional. The optional params parameter will be sent as parameters with the request. The optional request_params parameter will be applied to the ajax request options. An OAuth access token will be automatically added to the request, formatted properly for the API.

Integrations.salesforce.master.patch("/services/data/v35.0").done(function(response) {
  console.log(response)
})

master.post(path, params = {}, request_params = {})

This method is available to server-side scripts.

Makes a POST request to the given path with the master account for the integration. Master accounts allow facilities to use a single account for API access to the integration, rather than having users authenticate individually. The path will be appended to the base URL for the integration. A preceding slash is optional. The optional params parameter will be sent as parameters with the request. The optional request_params parameter will be applied to the ajax request options. An OAuth access token will be automatically added to the request, formatted properly for the API.

Integrations.salesforce.master.post("/services/data/v35.0").done(function(response) {
  console.log(response)
})

master.put(path, params = {}, request_params = {})

This method is available to server-side scripts.

Makes a PUT request to the given path with the master account for the integration. Master accounts allow facilities to use a single account for API access to the integration, rather than having users authenticate individually. The path will be appended to the base URL for the integration. A preceding slash is optional. The optional params parameter will be sent as parameters with the request. The optional request_params parameter will be applied to the ajax request options. An OAuth access token will be automatically added to the request, formatted properly for the API.

Integrations.salesforce.master.put("/services/data/v35.0").done(function(response) {
  console.log(response)
})

options(path, params = {}, request_params = {}()

This method is available to server-side scripts.

Makes an OPTIONS request to the given path. The path will be appended to the base URL for the integration. A preceding slash is optional. The optional params parameter will be sent as parameters with the request. The optional request_params parameter will be applied to the ajax request options. An OAuth access token will be automatically added to the request, formatted properly for the API.

Integrations.salesforce.options("/services/data/v35.0").done(function(response) {
  console.log(response)
})

patch(path, params = {}, request_params = {})

This method is available to server-side scripts.

Makes a PATCH request to the given path. The path will be appended to the base URL for the integration. A preceding slash is optional. The optional params parameter will be sent as parameters with the request. The optional request_params parameter will be applied to the ajax request options. An OAuth access token will be automatically added to the request, formatted properly for the API.

Integrations.salesforce.patch("/services/data/v35.0").done(function(response) {
  console.log(response)
})

post(path, params = {}, request_params = {})

This method is available to server-side scripts.

Makes a POST request to the given path. The path will be appended to the base URL for the integration. A preceding slash is optional. The optional params parameter will be sent as parameters with the request. The optional request_params parameter will be applied to the ajax request options. An OAuth access token will be automatically added to the request, formatted properly for the API.

Integrations.salesforce.post("/services/data/v35.0").done(function(response) {
  console.log(response)
})

put(path, params = {}, request_params = {})

This method is available to server-side scripts.

Makes a PUT request to the given path. The path will be appended to the base URL for the integration. A preceding slash is optional. The optional params parameter will be sent as parameters with the request. The optional request_params parameter will be applied to the ajax request options. An OAuth access token will be automatically added to the request, formatted properly for the API.

Integrations.salesforce.put("/services/data/v35.0").done(function(response) {
  console.log(response)
})

require()

This method is available to server-side scripts.

Requires the user to set up the integration before they can access the form. This is only performed frontend, and can be removed with DOM manipulation. We are working on stronger integration restrictions through the Form Editor. If the user has the integration set up, they won't see anything, and won't be interrupted. Returns a deferred object which will not resolve until the user either successfully authorized or declines to set up the integration.

Integrations.salesforce.require().done(function() {
  console.log("User set up the integration")
}).fail(function() {
  console.log("User declined to set up the integration")
})

user.delete(path, params = {}, request_params = {})

This method is available to server-side scripts.

Makes a PUT request to the given path with the user account for the integration. This forces the API request to use the user's account instead of defaulting to the master account if it's set up. The path will be appended to the base URL for the integration. A preceding slash is optional. The optional params parameter will be sent as parameters with the request. The optional request_params parameter will be applied to the ajax request options. An OAuth access token will be automatically added to the request, formatted properly for the API.

Integrations.salesforce.user.delete("/services/data/v35.0").done(function(response) {
  console.log(response)
})

user.get(path, params = {}, request_params = {})

This method is available to server-side scripts.

Makes a GET request to the given path with the user account for the integration. This forces the API request to use the user's account instead of defaulting to the master account if it's set up. The path will be appended to the base URL for the integration. A preceding slash is optional. The optional params parameter will be sent as parameters with the request. The optional request_params parameter will be applied to the ajax request options. An OAuth access token will be automatically added to the request, formatted properly for the API.

Integrations.salesforce.user.get("/services/data/v35.0").done(function(response) {
  console.log(response)
})

user.options(path, params = {}, request_params = {})

This method is available to server-side scripts.

Makes an OPTIONS request to the given path with the user account for the integration. This forces the API request to use the user's account instead of defaulting to the master account if it's set up. The path will be appended to the base URL for the integration. A preceding slash is optional. The optional params parameter will be sent as parameters with the request. The optional request_params parameter will be applied to the ajax request options. An OAuth access token will be automatically added to the request, formatted properly for the API.

Integrations.salesforce.user.options("/services/data/v35.0").done(function(response) {
  console.log(response)
})

user.patch(path, params = {}, request_params = {})

This method is available to server-side scripts.

Makes a PATCH request to the given path with the user account for the integration. This forces the API request to use the user's account instead of defaulting to the master account if it's set up. The path will be appended to the base URL for the integration. A preceding slash is optional. The optional params parameter will be sent as parameters with the request. The optional request_params parameter will be applied to the ajax request options. An OAuth access token will be automatically added to the request, formatted properly for the API.

Integrations.salesforce.user.patch("/services/data/v35.0").done(function(response) {
  console.log(response)
})

user.post(path, params = {}, request_params = {})

This method is available to server-side scripts.

Makes a POST request to the given path with the user account for the integration. This forces the API request to use the user's account instead of defaulting to the master account if it's set up. The path will be appended to the base URL for the integration. A preceding slash is optional. The optional params parameter will be sent as parameters with the request. The optional request_params parameter will be applied to the ajax request options. An OAuth access token will be automatically added to the request, formatted properly for the API.

Integrations.salesforce.user.post("/services/data/v35.0").done(function(response) {
  console.log(response)
})

user.put(path, params = {}, request_params = {})

This method is available to server-side scripts.

Makes a PUT request to the given path with the user account for the integration. This forces the API request to use the user's account instead of defaulting to the master account if it's set up. The path will be appended to the base URL for the integration. A preceding slash is optional. The optional params parameter will be sent as parameters with the request. The optional request_params parameter will be applied to the ajax request options. An OAuth access token will be automatically added to the request, formatted properly for the API.

Integrations.salesforce.user.put("/services/data/v35.0").done(function(response) {
  console.log(response)
})