{"_id":"59de6011debd1200240f690f","user":"547504ed59fade080004cb8b","version":{"_id":"59de6011debd1200240f68ee","__v":3,"project":"59de6011debd1200240f68ec","createdAt":"2016-06-20T18:15:42.514Z","releaseDate":"2016-06-20T18:15:42.514Z","categories":["59de6011debd1200240f68fb","59de6011debd1200240f68fa","59de6011debd1200240f68fc","59de6011debd1200240f68f8","59de6011debd1200240f68f7","59de6011debd1200240f68f9","59de6011debd1200240f68fd","59de6011debd1200240f68fe","59de6011debd1200240f68ff","5a8bfb99f4146e00449cec47","5a8bfcf2e86f530012159bb2","5cd4c29c6ea1040056ec0f55"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2.0"},"project":"59de6011debd1200240f68ec","category":{"_id":"59de6011debd1200240f68fd","project":"59de6011debd1200240f68ec","__v":0,"version":"59de6011debd1200240f68ee","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-06-21T21:33:48.049Z","from_sync":false,"order":1,"slug":"api-use-cases","title":"API Use Cases"},"__v":0,"parentDoc":null,"githubsync":"","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-06-21T21:47:10.204Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"Fountain integrates with custom elements of your workflow through a combination of webhooks and PUT requests. Webhooks are used when external action is needed when an applicant arrives at a particular stage. \n\n**Example: When the applicants reach a particular stage, fire a webhook which will send them a text to download an app. When they do, update a label in Fountain.**\n___\n\n#### 1. Fire a webhook trigger\nWhen an applicant lands in a particular stage (Rejected in this example), a trigger fires to a third-party webhook URL with all of the applicant's details. In this example, we want phone number and type so we can send them a text with a link to the app. The payload is delivered as JSON object which includes the applicant's UUID, which will be used to target them when it's time to move pass the applicant along.\n \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/Uajf7UZgTVGva3dDt5Bi_Screen%20Shot%202016-06-21%20at%2012.01.18%20PM.png\",\n        \"Screen Shot 2016-06-21 at 12.01.18 PM.png\",\n        \"2450\",\n        \"368\",\n        \"#d43c31\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n#### 2. Third-party sends applicant a text\nWith the applicant's phone number, the third-party provider sends the applicant a text message to download the app based on the phone type. \n#### 3. Complete the label with a [PUT request](https://Fountain.readme.io/v2.0/docs/update-label-for-applicant)\nWhen the applicant downloads and signs into the app with their Fountain email address, the third-party provider sends a PUT request to Fountain to update the 'App Downloaded' label. If the 'Auto-Advance when all labels are checked' setting is on in in your manual stage (you can toggle this in the Workflow Editor), the applicant automatically moves on to the next stage. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X PUT -H 'Content-Type: application/json' -d '{\\\"completed\\\":true,\\\"api_token\\\":\\\"secret-api-token\\\"}' 'https://api.fountain.com/v2/applicants/22222222-0000-0000-0000-000000000000/labels/App%20Downloaded'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\n#### 5. Want add applicant data?\nIf you wish to append data to the applicant, just do so with another [PUT request](https://fountain.readme.io/v2.0/docs/testinput) before auto-advancing the applicant. That's it!\n\n**Example: Using our API and a filter in your workflow, you can reject applicants from third-party sources. For this example, you'll need applicants in a stage before the Rejected stage. In this example let's call this Manual stage.**\n\n#### 1. Set up your label\nFirst, set up a label which signifies the completion of your Manual stage. Make sure the 'Auto-Advance when all labels are checked' setting is on.\n\n#### 2. Make a filter\nYou'll need to create a filter based on some field that you'll set for the applicant via PUT. Here, we simply call it \"reject\" - if an applicant passes into the filter with reject = \"not experienced\", they'll be rejected with that reason.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/nkZawlv7Q3SmzouQYwkY_reject.png\",\n        \"reject.png\",\n        \"783\",\n        \"286\",\n        \"#eaeaeb\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n#### 3. Set your filter field with a [PUT request](https://fountain.readme.io/v2.5/docs/testinput)\nNext you'll set whatever field your filter uses for a particular applicant in the Manual stage (use List Applicants to get applicant_id's).\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X PUT -H 'Content-Type: application/json' -d '{\\\"data\\\":{\\\"reject\\\":\\\"not experienced\\\"},\\\"api_token\\\":\\\"secret-api-token\\\"}' ' https://api.fountain.com/v2/applicants/c6786558-1b20-4e44-b303-75e21b965ed7/'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\n#### 4. Complete the label with a [PUT request](https://fountain.readme.io/v2.0/docs/update-label-for-applicant)\nFinally, set the label you made to completed. The applicant will move into the filter, then they'll be pushed into Rejected stage.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X PUT -H 'Content-Type: application/json' -d '{\\\"completed\\\":true,\\\"api_token\\\":\\\"secret-api-token\\\"}' 'https://api.fountain.com/v2/applicants/22222222-0000-0000-0000-000000000000/labels/reviewed'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"custom-integrations","type":"basic","title":"Custom Integrations"}

Custom Integrations


Fountain integrates with custom elements of your workflow through a combination of webhooks and PUT requests. Webhooks are used when external action is needed when an applicant arrives at a particular stage. **Example: When the applicants reach a particular stage, fire a webhook which will send them a text to download an app. When they do, update a label in Fountain.** ___ #### 1. Fire a webhook trigger When an applicant lands in a particular stage (Rejected in this example), a trigger fires to a third-party webhook URL with all of the applicant's details. In this example, we want phone number and type so we can send them a text with a link to the app. The payload is delivered as JSON object which includes the applicant's UUID, which will be used to target them when it's time to move pass the applicant along. [block:image] { "images": [ { "image": [ "https://files.readme.io/Uajf7UZgTVGva3dDt5Bi_Screen%20Shot%202016-06-21%20at%2012.01.18%20PM.png", "Screen Shot 2016-06-21 at 12.01.18 PM.png", "2450", "368", "#d43c31", "" ] } ] } [/block] #### 2. Third-party sends applicant a text With the applicant's phone number, the third-party provider sends the applicant a text message to download the app based on the phone type. #### 3. Complete the label with a [PUT request](https://Fountain.readme.io/v2.0/docs/update-label-for-applicant) When the applicant downloads and signs into the app with their Fountain email address, the third-party provider sends a PUT request to Fountain to update the 'App Downloaded' label. If the 'Auto-Advance when all labels are checked' setting is on in in your manual stage (you can toggle this in the Workflow Editor), the applicant automatically moves on to the next stage. [block:code] { "codes": [ { "code": "curl -X PUT -H 'Content-Type: application/json' -d '{\"completed\":true,\"api_token\":\"secret-api-token\"}' 'https://api.fountain.com/v2/applicants/22222222-0000-0000-0000-000000000000/labels/App%20Downloaded'", "language": "curl" } ] } [/block] #### 5. Want add applicant data? If you wish to append data to the applicant, just do so with another [PUT request](https://fountain.readme.io/v2.0/docs/testinput) before auto-advancing the applicant. That's it! **Example: Using our API and a filter in your workflow, you can reject applicants from third-party sources. For this example, you'll need applicants in a stage before the Rejected stage. In this example let's call this Manual stage.** #### 1. Set up your label First, set up a label which signifies the completion of your Manual stage. Make sure the 'Auto-Advance when all labels are checked' setting is on. #### 2. Make a filter You'll need to create a filter based on some field that you'll set for the applicant via PUT. Here, we simply call it "reject" - if an applicant passes into the filter with reject = "not experienced", they'll be rejected with that reason. [block:image] { "images": [ { "image": [ "https://files.readme.io/nkZawlv7Q3SmzouQYwkY_reject.png", "reject.png", "783", "286", "#eaeaeb", "" ] } ] } [/block] #### 3. Set your filter field with a [PUT request](https://fountain.readme.io/v2.5/docs/testinput) Next you'll set whatever field your filter uses for a particular applicant in the Manual stage (use List Applicants to get applicant_id's). [block:code] { "codes": [ { "code": "curl -X PUT -H 'Content-Type: application/json' -d '{\"data\":{\"reject\":\"not experienced\"},\"api_token\":\"secret-api-token\"}' ' https://api.fountain.com/v2/applicants/c6786558-1b20-4e44-b303-75e21b965ed7/'", "language": "curl" } ] } [/block] #### 4. Complete the label with a [PUT request](https://fountain.readme.io/v2.0/docs/update-label-for-applicant) Finally, set the label you made to completed. The applicant will move into the filter, then they'll be pushed into Rejected stage. [block:code] { "codes": [ { "code": "curl -X PUT -H 'Content-Type: application/json' -d '{\"completed\":true,\"api_token\":\"secret-api-token\"}' 'https://api.fountain.com/v2/applicants/22222222-0000-0000-0000-000000000000/labels/reviewed'", "language": "curl" } ] } [/block]