SkySlope Auth API

The Auth API from SkySlope — 1 operation(s) for auth.

OpenAPI Specification

skyslope-auth-api-openapi.yml Raw ↑
openapi: 3.1.3
info:
  x-logo:
    url: https://s3.amazonaws.com/cdn.skyslope.com/forms/forms-logo-w-top-padding.png
    href: https://skyslope.com/
    altText: SkySlope
  title: SkySlope Partnership API Reference Agents, Listings Auth API
  version: 1.0.0
  description: "# Introduction\n  The SkySlope Forms API is organized around [REST](https://en.wikipedia.org/wiki/Representational_state_transfer).\n  Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses,\n  and uses standard HTTP response codes, authentication, and verbs.<br/><br/>\n  NOTE: Endpoints marked with an asterisk (*) will be available to our partners in the near future.\n  # Authentication\n  This API uses [OAuth 2.0 authorization code flow](https://www.oauth.com/oauth2-servers/server-side-apps/authorization-code/)\n  to obtain an access token that can be used to authenticate subsequent API requests.\n  ## Access Tokens\n  ### Request\n  To obtain an access token, first redirect the user to the authorization endpoint:\n  ```\n  https://accounts.skyslope.com/oauth2/authorize?\n    response_type=code\n    &client_id={YOUR_CLIENT_ID}\n    &redirect_uri={YOUR_REDIRECT_URI}\n    &scope=forms.files\n    &state={RANDOM_STATE_VALUE}\n    &code_challenge={CODE_CHALLENGE}\n    &code_challenge_method=S256\n  ```\n  After the user authorizes your application, they'll be redirected back to your redirect URI with an authorization code.\n  Exchange this code for an access token by making a POST request to the token endpoint:\n  ```\n  POST /oauth2/token HTTP/1.1\n  Host: accounts.skyslope.com\n  Content-Type: application/x-www-form-urlencoded\n  \n  grant_type=authorization_code\n  &client_id={YOUR_CLIENT_ID}\n  &client_secret={YOUR_CLIENT_SECRET}\n  &code={AUTHORIZATION_CODE}\n  &redirect_uri={YOUR_REDIRECT_URI}\n  &code_verifier={CODE_VERIFIER}\n  ```\n  ### Usage\n  Authentication to the API is performed by including your access token in the **Authorization** header of your\n  API requests with the Bearer authentication scheme:\n  ```\n  GET /partner/api/files HTTP/1.1\n  Host: forms.skyslope.com\n  Authorization: Bearer {YOUR_ACCESS_TOKEN}\n  ```\n  All API requests must be made over [HTTPS](https://en.wikipedia.org/wiki/HTTPS). Calls made over plain HTTP will fail.\n  API requests without authentication will also fail.\n  ## Refresh Tokens\n  Refresh tokens allow you to obtain new access tokens without requiring the user to re-authenticate. When you first\n  complete the OAuth flow, you'll receive both an access token and a refresh token.\n  ### Request\n  To receive a refresh token, include the `offline_access` scope in your initial authorization request:\n  ```\n  https://accounts.skyslope.com/oauth2/authorize?\n    response_type=code\n    &client_id={YOUR_CLIENT_ID}\n    &scope=forms.files offline_access\n    &redirect_uri={YOUR_REDIRECT_URI}\n  ```\n  ### Usage\n  When your access token expires, make a POST request to the token endpoint:\n  ```\n  POST /oauth2/token HTTP/1.1\n  Host: accounts.skyslope.com\n  Content-Type: application/x-www-form-urlencoded\n  \n  grant_type=refresh_token\n  &client_id={YOUR_CLIENT_ID}\n  &client_secret={YOUR_CLIENT_SECRET}\n  &refresh_token={YOUR_REFRESH_TOKEN}\n  ```\n  This will return a new access token and refresh token pair.\n  ### Security Best Practices\n  - Store refresh tokens securely on your backend server, never on client side\n  - Encrypt refresh tokens at rest using strong encryption\n  - Rotate refresh token on each use\n  - Set up monitoring for unusual refresh token usage patterns\n  - If a refresh token is compromised, revoke it immediately using the token revocation endpoint\n  - Implement automatic cleanup of unused refresh tokens"
  termsOfService: https://skyslope.com/terms-conditions/
  contact:
    name: Support
    url: https://support.skyslope.com/hc/en-us
    email: support@skyslope.com
servers:
- url: https://forms.skyslope.com/partner/api
  description: Production server
- url: https://staging-forms.skyslope.com/partner/api
  description: Staging server
- url: https://integ-forms.skyslope.com/partner/api
  description: Integration server
tags:
- name: Auth
paths:
  /ext/token:
    post:
      summary: Retrieve an access token
      description: Retrieve an access token to authenticate requests with.
      tags:
      - Auth
      parameters:
      - in: header
        name: Authorization
        schema:
          type: string
        required: true
        description: '<code>Basic BASE64_CREDENTIALS</code>


          "BASE64_CREDENTIALS" is the Base64-encoded value of your Client ID and Client Secret, separated by a colon

          '
      x-codeSamples:
      - lang: cURL
        source: 'curl --location --request POST ''https://offers.skyslope.com/offers-api/ext/token'' \ --header ''Authorization: Basic BASE64_CREDENTIALS''

          '
      - lang: Javascript
        source: "var myHeaders = new Headers(); myHeaders.append(\"Authorization\", \"Basic BASE64_CREDENTIALS);\nvar requestOptions = {\n  method: 'POST',\n  headers: myHeaders,\n  redirect: 'follow'\n};\nfetch(\"https://offers.skyslope.com/offers-api/ext/token\", requestOptions)\n  .then(response => response.text())\n  .then(result => console.info(result))\n  .catch(error => console.info('error', error));\n"
      - lang: Python
        source: "import requests\n\nurl = \"https://offers.skyslope.com/offers-api/ext/token\"\n\npayload = {}\nheaders = {\n  'Authorization': 'Basic BASE64_CREDENTIALS'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
      - lang: C#
        source: 'var client = new HttpClient();


          var request = new HttpRequestMessage(HttpMethod.Post, "https://offers.skyslope.com/offers-api/ext/token");

          request.Headers.Add("Authorization", "Basic BASE64_CREDENTIALS");


          var response = await client.SendAsync(request);

          response.EnsureSuccessStatusCode();


          Console.WriteLine(await response.Content.ReadAsStringAsync());

          '
      - lang: PHP
        source: "<?php\n$curl = curl_init();\ncurl_setopt_array($curl, array(\n  CURLOPT_URL => 'https://offers.skyslope.com/offers-api/ext/token',\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => '',\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 0,\n  CURLOPT_FOLLOWLOCATION => true,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => 'POST',\n  CURLOPT_HTTPHEADER => array(\n    'Authorization: Basic BASE64_CREDENTIALS'\n  ),\n));\n$response = curl_exec($curl);\ncurl_close($curl); echo $response;\n"
      - lang: Ruby
        source: 'require "uri" require "net/http"

          url = URI("https://offers.skyslope.com/offers-api/ext/token")

          http = Net::HTTP.new(url.host, url.port); request = Net::HTTP::Post.new(url) request["Authorization"] = "Basic Basic BASE64_CREDENTIALS"

          response = http.request(request) puts response.read_body

          '
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  token_type:
                    type: string
                  expires_in:
                    type: number
                  access_token:
                    type: string
              example:
                token_type: Bearer
                expires_in: 3600
                access_token: ACCESS_TOKEN
        '204':
          description: No Content
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '500':
          description: Internal Server Error