---
title: Endpoints
slug: endpoints
docTags: 
createdAt: 2020-04-06T11:36:53.000Z
---

Pathfix has a single pattern for calls to all providers. Changing the `user_id`and `public_key`*provides&#x20;*&#x74;he endpoint with the instruction to invoke the correct access\_token needed to to complete the API request.  The list of supported OAuth Providers names can be found [Provider reference](docId\:Z26CDo6omB40W2fyMu_UT)


`POST https://labs.pathfix.com/oauth/method/{providername}/call`



## Example

An example of how a call will be made to Google Calendar to get a List of Calendars for the connected user.&#x20;
**Assumptions**

- Your application user is <font color="#ce9178">"jane.doe@example.com"</font>
- Your Pathfix Application public key is <font color="#ce9178">"aaaa-bbbb-cccc-dddd"</font>
- The user jane.doe\@example.com has previously logged into your solution and connected their Google Calendar.

```javascript



function pushMessage() {
    //build the payload
    //payload and header can be excluded in they do not carry any information 
    var pfxPayload =    {
        "url":"https://www.googleapis.com/calendar/v3/users/me/calendarList",
        "method":"GET",
        "payload":{},
        "headers":{}
    };

    //build the url
    var pfxUrl = new URL("https://labs.pathfix.com/oauth/method/googlecalendar/call");
    pfxUrl.searchParams.set("user_id", "jane.doe@example.com");
    pfxUrl.searchParams.set("public_key", "aaaa-bbbb-cccc-dddd");

    //POST to pathfix
    $.post(pfxUrl,JSON.stringify(pfxPayload),(response)=>{console.log(response)});
}`


```



### Success Response

```javascript

{
    "rows":[
        {
            "pincStatus":"success",
            "statusCode":200,
            "contentType":"application/json",
            "data":{
                
            }
        }
    ]
}

```

The data returned from the provider (Google Calendar) will be container in the `rows[0].data` . Documentation about the information in returned can be found at the provider API documentation.&#x20;

### &#xA;Error Response

```javascript

{
    "rows":[
        {
            "pincStatus":"error",
            "statusCode":"HTTP_STATUS_CODE",
            "errorType":"ERROR-TYPES",
            "inernalError":""
        }
    ]
}

```

List of ERROR-TYPES and their description can be found here [Error codes](docId\:UwWE7r_eMOy07swNHjYdW)





