WeFitter token API

Before any calls can be made to wefitter, BasicAuth is needed to verify the identity of the requesting party. This call will result into a Bearer token which has administrator privileges and is valid for 1 day. This token can be used to create profiles, challenges, etc. The returned bearer is a JWT (JSON Web Token).

OpenAPI Specification

wefitter-token-api-openapi.yml Raw ↑
swagger: '2.0'
info:
  title: WeFitter app token API
  description: This is the WeFitter API
  termsOfService: https://www.wefitter.com/privacy/
  contact:
    email: hello@wefitter.com
  license:
    name: BSD License
  version: v1.3
host: api.wefitter.com
basePath: /api/v1.3
schemes:
- https
consumes:
- application/json
produces:
- application/json
security:
- BearerProfile: []
tags:
- name: token
  description: '

    <p>

    Before any calls can be made to wefitter, BasicAuth is needed to verify the identity of the requesting party.

    This call will result into a Bearer token which has administrator privileges and is valid for 1 day.

    This token can be used to create profiles, challenges, etc.

    </p>


    <p>

    The returned bearer is a JWT (<a href="https://en.wikipedia.org/wiki/JSON_Web_Token">JSON Web Token</a>).

    </p>

    '
paths:
  /token/:
    parameters: []
    post:
      operationId: token_create
      summary: Create Token
      description: "\nIn order to create a token, perform a POST request to this endpoint, example:<br/>\n<table><tbody>\n    <tr><td>Application ID</td><td>123</td></tr>\n    <tr><td>Application Secret</td><td>ABC</td></tr>\n    <tr><td>Authorization header format</td><td>Authorization: base64(app_id:app_secret)</td></tr>\n    <tr><td>Expected result</td><td>Authorization: MTIzOkFCQw==</td></tr>\n</tbody></table>\nFor testing purposes, a CURL can be used:\n<pre>\ncurl -X POST -H \"Authorization: Basic MTIzOkFCQw==\" https://api.wefitter.com/api/v1.3/token/\n# alternatively\ncurl -X POST --user 123:ABC https://api.wefitter.com/api/v1.3/token/\n</pre>\n\nThe response to a successful request should look like this:\n<pre>\n{\n    \"bearer\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOiIxNTY2NTYxMzk2IiwiaWF0IjoxNTE2MjM5MDIyfQ.14x12h5VMJjAV2kFB5cCrfFmZhryBAYGk9N-vhyDl00\"\n}\n</pre>\n"
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/Token'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/Token'
      tags:
      - token
      security:
      - Basic: []
      deprecated: false
definitions:
  Token:
    type: object
    properties:
      bearer:
        title: Bearer
        type: string
        readOnly: true
        minLength: 1
securityDefinitions:
  Basic:
    type: basic
    description: 'Basic Authentication is used to create administrator bearer tokens.


      Once a bearer token has been made, remove this auth. (''logout'' in Swagger'')'
  BearerProfile:
    type: apiKey
    name: Authorization
    in: header
    description: 'Bearer authentication for logged-in profiles.


      When using the GUI, please don''t forget to prefix your bearer tokens with the text ''bearer'', followed by a space.'
  BearerAdmin:
    type: apiKey
    name: Authorization
    in: header
    description: 'Bearer authentication for administrators.


      When using the GUI, please don''t forget to prefix your bearer tokens with the text ''bearer'', followed by a space.'