DEVELOPER CENTER
...
Webhooks (Preview)
User Subscribe
1 min
this api notifies the pathfix automation's webhook module to start listening for webhooks for the given user id the api will always return a success message but will only really work if the user id is connected via pathfix oauth and the webhook is in an active state { "tab" "examples", "url" "https //labs pathfix com/api/webhook/{{provider}}/user subscribe", "name" "user subscribe api", "method" "post", "request" { "pathparameters" \[], "queryparameters" \[ { "kind" "required", "name" "user id", "type" "string", "description" "identifier of your currently logged in user" }, { "kind" "required", "name" "public key", "type" "string", "description" "your pathfix application's public key" }, { "kind" "required", "name" "private key", "type" "string", "description" "your pathfix application's private key" } ], "headerparameters" \[], "bodydataparameters" \[], "formdataparameters" \[] }, "results" { "languages" \[ { "id" " bhhpsilcjvcku umegek", "code" "{\n \\"rows\\" \[\n {\n \\"pincstatus\\" \\"success\\",\n \\"callid\\" \\"00dd76ab f623 48ae 9448 8b3f665ceef5\\",\n \\"data\\" \\"webhook subscription notification sent to pathfix automation for user id {{user id}} and provider {{provider}}\\"\n }\n ]\n}", "language" "200" }, { "id" "jeo4iohkbj3wfmtigve55", "code" "unauthorized", "language" "403", "customlabel" "" } ], "selectedlanguageid" "jeo4iohkbj3wfmtigve55" }, "examples" { "languages" \[ { "id" "mrpkxrnjpln wchjnxhks", "code" "curl request get\n url https //labs pathfix com/api/webhook/{{provider}}/user subscribe\n d user id={{user id}}\n d public key={{public key}}\n d private key={{private key}}\n header 'accept application/json'", "language" "curl", "customlabel" "" }, { "id" "wxffudrtswj50kkfgjr7g", "code" "const fetch = require('node fetch');\n\nlet url = 'https //labs pathfix com/api/connection';\nlet options = {\n method 'get', \nheaders {\n accept 'application/json',\n }\n};\nfetch(url, options)\n then(res => res json())\n then(json => console log(json))\n catch(err => console error('error ' + err));", "language" "nodejs" }, { "id" "o22umscxnzdnlhqor1eqv", "code" "import requests\n\nurl = \\"https //labs pathfix com/api/connection\\"\nheaders = {\\"accept\\" \\"application/json\\"}\nresponse = requests request(\\"get\\", url, headers=headers)\nprint(response text)", "language" "python" }, { "id" "vyb1psi4ibaoeniwgtyh4", "code" "const fetch = require('node fetch');\n\nlet url = 'https //labs pathfix com/api/connection';\nlet options = {method 'get', headers {accept 'application/json'}};\nfetch(url, options)\n then(res => res json())\n then(json => console log(json))\n catch(err => console error('error ' + err));", "language" "ruby" }, { "id" "mybssoyon9cxl6ytanijc", "code" "var request = require('request');\nvar options = {\n 'method' 'post',\n 'url' 'https //labs pathfix com/api/webhook/{{provider}}/user subscribe?user id=string\&public key=string\&private key=string',\n 'headers' {\n 'accept' 'application/json'\n }\n};\nrequest(options, function (error, response) {\n if (error) throw new error(error);\n console log(response body);\n});\n", "language" "nodejs", "customlabel" "" }, { "id" "unbb7fucueefg1huoxla9", "code" "var myheaders = new headers();\nmyheaders append(\\"accept\\", \\"application/json\\");\n\nvar requestoptions = {\n method 'post',\n headers myheaders,\n redirect 'follow'\n};\n\nfetch(\\"https //labs pathfix com/api/webhook/{{provider}}/user subscribe?user id=string\&public key=string\&private key=string\\", requestoptions)\n then(response => response text())\n then(result => console log(result))\n catch(error => console log('error', error));", "language" "javascript", "customlabel" "" }, { "id" "8kt5ptgrkjjhip1si8 7u", "code" "import requests\n\nurl = \\"https //labs pathfix com/api/webhook/{{provider}}/user subscribe?user id=string\&public key=string\&private key=string\\"\n\npayload={}\nheaders = {\n 'accept' 'application/json'\n}\n\nresponse = requests request(\\"post\\", url, headers=headers, data=payload)\n\nprint(response text)\n", "language" "python", "customlabel" "" }, { "id" "qsg4iukwpyb0eiinh971g", "code" "require \\"uri\\"\nrequire \\"net/http\"\n\nurl = uri(\\"https //labs pathfix com/api/webhook/{{provider}}/user subscribe?user id=string\&public key=string\&private key=string\\")\n\nhttps = net http new(url host, url port)\nhttps use ssl = true\n\nrequest = net http post new(url)\nrequest\[\\"accept\\"] = \\"application/json\\"\n\nresponse = https request(request)\nputs response read body\n", "language" "ruby", "customlabel" "" }, { "id" "wel3t8gxh8umo mln4oph", "code" "curl location g request post 'https //labs pathfix com/api/webhook/{{provider}}/user subscribe?user id=string\&public key=string\&private key=string' \\\\\n header 'accept application/json'", "language" "curl", "customlabel" "" }, { "id" "9nqnmfom8ym6ydgkuoeo ", "code" "var request = require('request');\nvar options = {\n 'method' 'post',\n 'url' 'https //labs pathfix com/api/webhook/{{provider}}/user subscribe?user id=string\&public key=string\&private key=string',\n 'headers' {\n 'accept' 'application/json'\n }\n};\nrequest(options, function (error, response) {\n if (error) throw new error(error);\n console log(response body);\n});\n", "language" "nodejs", "customlabel" "" }, { "id" "yb0vpzdfx2fvkh2vqukvq", "code" "var myheaders = new headers();\nmyheaders append(\\"accept\\", \\"application/json\\");\n\nvar requestoptions = {\n method 'post',\n headers myheaders,\n redirect 'follow'\n};\n\nfetch(\\"https //labs pathfix com/api/webhook/{{provider}}/user subscribe?user id=string\&public key=string\&private key=string\\", requestoptions)\n then(response => response text())\n then(result => console log(result))\n catch(error => console log('error', error));", "language" "javascript", "customlabel" "" }, { "id" "klnrclq8podazyuifr4uu", "code" "import requests\n\nurl = \\"https //labs pathfix com/api/webhook/{{provider}}/user subscribe?user id=string\&public key=string\&private key=string\\"\n\npayload={}\nheaders = {\n 'accept' 'application/json'\n}\n\nresponse = requests request(\\"post\\", url, headers=headers, data=payload)\n\nprint(response text)\n", "language" "python", "customlabel" "" }, { "id" "dt erx7fzyavafm d35sa", "code" "require \\"uri\\"\nrequire \\"net/http\"\n\nurl = uri(\\"https //labs pathfix com/api/webhook/{{provider}}/user subscribe?user id=string\&public key=string\&private key=string\\")\n\nhttps = net http new(url host, url port)\nhttps use ssl = true\n\nrequest = net http post new(url)\nrequest\[\\"accept\\"] = \\"application/json\\"\n\nresponse = https request(request)\nputs response read body\n", "language" "ruby", "customlabel" "" } ], "selectedlanguageid" "mrpkxrnjpln wchjnxhks" }, "description" "call this api to subscribe a user to an active webhook \n", "currentnewparameter" { "label" "query parameter", "value" "queryparameters" } }