GETTING STARTED
Introduction

Enable pass-through API

4min
once you have setup your oauth connect button, you will need to make every api call through pathfix so we can stamp every required token to the api before passing it on to the provider (i e pass through) you will need to complete the end user authorization with the provider to be able to consume any provider endpoint once completed, you can setup the api call between the 2 apps using the api call code need documentation for end user authorization setup? check it here end user authorization docid\ mscmngugrsgrzscmlcixf api call template each providers api call is different and would be explained in detail on their own developer documentation here is template of how an api call would be created to go through pathfix select the app you would like to make the api call for, click on setup and select api call you can write either client side or server side code to send messages to your end user’s application copy the code and paste it to your desired code base http post https //labs pathfix com/oauth/method/slackv2/call?user id=marketsaas end user id\&public key=2370a0ba 9fe4 4b20 916d 00d0f15a43e1\&private key=ba3176f4 dcfe 42fc 860f 1f9e817c0861 content type application/json { "url" "url to slackv2 api", "method" "method to use with this call", "payload" {payload as requested by slackv2}, "headers" {header if requested by slackv2} } var client = new restclient("https //labs pathfix com/oauth/method/drift/call?userid=myapp end user id\&pinc client id=9a68becf 90bd 4583 89b5 18ff6b68f7b0"); client timeout = 1; var request = new restrequest(method post); request addheader("content type", "application/json"); request addparameter("application/json", "{\\"url\\" \\"url to drift api",\\"method\\" \\"method to use with this call\\",\\"payload\\" {payload as requested by drift},\\"headers\\" {headers if requested by drift}}", parametertype requestbody); irestresponse response = client execute(request); console writeline(response content); / when using javascript make sure to include a reference to the script file defined in the previous step client side invocations need some additional information to authenticate the request / var settings = { "url" "https //labs pathfix com/oauth/method/drift/call?userid=myapp end user id\&public key9a68becf 90bd 4583 89b5 18ff6b68f7b0", "method" "post", "timeout" 0, "headers" { "content type" "application/json" }, "data" json stringify({ "url" "url to drift api", "method" "method to use with this call", "payload" { payload as requested by drift }, "headers" { headers if requested by drift } }) }; $ ajax(settings) done(function (response) { console log(response); }); post /oauth/method/drift/call?userid=test4 end user id\&pinc client id=9a68becf 90bd 4383 89b5 18ff6b68f7b0 http/1 1 host labs pathfix com content type application/json{ "url" "url to drift api", "method" "method to use with this call", "payload" { payload as requested by drift }, "headers" { header if requested by drift } } import requests url = "https //labs pathfix com/oauth/method/drift/call?userid=myapp end user id\&pinc client id=9a68becf 90bd 4583 89b5 18ff6b68f7b0" payload = "{\\"url\\" \\"url to drift api",\\"method\\" \\"method to use with this call\\",\\"payload\\" {payload as requested by drift},\\"headers\\" {headers if requested by drift}}" headers = { 'content type' 'application/json' } response = requests request("post", url, headers=headers, data = payload) print(response text encode('utf8')) replacements marketsaas end user id – change the marketsaas end user id with the user id associated with your app this is generally the email address or username or any unique id associated with your user in your app url to provider api – this is different for each application and refers to the endpoint to the provider’s web api please note each method call for the provider will have its own url \ method to use with this call – enter a supported http method which is defined by the provider these usually are get, post, delete, put \ payload as requested by provider – most api integrations accept the information as application/json when pushing information while using an api to pull information from them this section is usually empty if there is no payload make sure you pass an empty {} when parameters are sent using the get you can add them to the endpoint url as defined by the provider sample api call setup there are a few sample api calls available for each provider that you can access click on test connection and select a sample method from the dropdown here is a sample call setup for slack that’s it, you can make calls to any providers api using pathfix's api passthrough for all of your connected users having trouble? reach out to us at support\@pathfix com and we would be happy to help you