Skip to content

Instantly share code, notes, and snippets.

@remoteweb
Last active November 4, 2016 14:03
Show Gist options
  • Save remoteweb/2c94c22572e20c5bc23cbf5425bb2277 to your computer and use it in GitHub Desktop.
Save remoteweb/2c94c22572e20c5bc23cbf5425bb2277 to your computer and use it in GitHub Desktop.

API Documentation for FrameCAD Licensing

The frameCAD Licensing API is an HTTP API which speaks JSON.

The following document refers to version 1 (v1) of the API.

General

Every response from the server is decorated with a now key which returns the current time on the server.

Also every response includes a message (for the humans to understand what have happened) and a code, except HTTP status code, (for the machines, eg, the frameCAD main application, to understand the outcome of the request).

When requesting for Licenses the following codes are available

  • ok: 0
  • missing: 1
  • reserved_by_other_client: 2
  • already_activated: 3
  • expired: 4
  • revoked: 5
  • invalid: 6
  • not_activated: 7
  • no_machine_key: 8
  • deactivated: 9
  • no_product_key: 10
  • wrong_product_key: 11
  • wrong_client: 12
  • unknown: 13

Endpoints

POST /api/v1/licenses/activate

The activate endpoint tries to activate a License and associate it with a client, whilst doing all the nessesary checks and bookskeeping.

Headers

You shall send the header Content-Type with value 'application/json'

Params

You shall submit the following post data:

  • A client_key of an existing (in frameCAD database) client to indetify with
  • A license_key which is the license key you desire to bind with the client
  • A machine_key generated by frameCAD main application in order to bind the license key and the client with it
  • A product_key generated by frameCAD main application in order to identify if the given license is associated with the correct product

An example request JSON payload looks like;

{
  'client_key': "E3200EA9C4D291CA",
  'license_key': "H7AS-6IS8-R3V1-V6B9"
  'machine_key': "XXXXXXXXXXXXXXXXXXXXX"
}

And an example response looks like this

{ message: 'License key CEHV-ZJO0-NW24-3JGW has already been taken by another user',
  code: 2,
  now: '2016-06-11T22:12:42.778+03:00',
  license:
   { id: 10,
     license_key: 'CEHV-ZJO0-NW24-3JGW',
     machine_key: 'ABS-123-123',
     expiration_date: '2017-06-03T15:45:55.000Z',
     status: 'activated',
     created_at: '2016-06-02T18:44:34.000Z',
     updated_at: '2016-06-03T15:45:55.000Z',
     client_id: 1 } }

POST /api/v1/licenses/validate

The validate endpoint cheks if a License and associated with the current client, whilst doing all nessesary bookskeeping.

Headers

You shall send the header Content-Type with value 'application/json'

Params

You shall submit the following post data:

  • A client_key of an existing (in frameCAD database) client to indetify with
  • A license_key which is the license key you desire to check
  • A machine_key which is the machine key binded to the above license

An example request JSON payload looks like;

{
  'client_key': "E3200EA9C4D291CB",
  'license_key': "H7AS-6IS8-R3V1-V6B8"
  'machine
}

And an example response looks like this

{ message: 'License key CEHV-ZJO0-NW24-3JGW is activated and valid',
  license:
   { id: 10,
     reserved: false,
     license_key: 'CEHV-ZJO0-NW24-3JGW',
     machine_key: 'ABCD-1234-DEFG-5678',
     machine_key: 'KOKOLALA',
     expiration_date: '2017-06-03T15:45:55.000Z',
     status: 'activated',
     created_at: '2016-06-02T18:44:34.000Z',
     updated_at: '2016-06-11T20:15:20.000Z',
     client_id: 2 },
  now: '2016-06-11T23:15:31.237+03:00',
  code: 0 }

GET /api/v1/licenses/first_check

Same as validate, only it's GET and does different bookskeeping.

GET /api/v1/licenses/last_check

Same as validate, only it's GET and does different bookskeeping.

DELETE /api/v1/license/deactivate

The deactivate endpoint tries to dactivate a License and un-associate it from a client, whilst doing all the nessesary checks and bookskeeping.

Headers

You shall send the header Content-Type with value 'application/json'

Params

You shall submit the following post data:

  • A client_key of an existing (in frameCAD database) client to indetify with
  • A license_key which is the license key you desire to unbind from the client
  • A machine_key generated by frameCAD main application in order to properly authenticate and avoid malicious usage.

An example request JSON payload looks like;

{
  'client_key': "E3200EA9C4D291CB",
  'license_key': "H7AS-6IS8-R3V1-V6B8"
  'machine_key': "XXXXXXXXXXXXXXXXXXXXX"
  'product_key': "XXXXXXXXXXXXXXXXXXXXX"
}

And an example response looks like this

{ message: 'License key HIOZ-W7RA-JNET-X039 was deactivated by user 3D9AACA84BEC559A.',
  code: 9,
  now: '2016-06-23T20:41:39.722+03:00',
  license:
   { id: 11,
     reserved: false,
     license_key: 'HIOZ-W7RA-JNET-X039',
     machine_key: null,
     expiration_date: null,
     status: 'deactivated',
     created_at: '2016-06-23T17:35:59.000Z',
     updated_at: '2016-06-23T17:41:39.704Z',
     client_id: null } }

Data

Licenses available for production are:

HIOZ-W7RA-JNET-X039
I3KO-I1NB-LS8U-QF96
K86T-1AYR-13FO-P7KJ
BJG4-AVGI-30QK-A7FQ
DKIP-CE96-9SU5-1TUC
9BFA-5M4Q-TJ28-DE1P
8ESY-ZKL8-GWCP-EXCT
Q1VI-3EP6-9K2P-F6GC
S8T5-D3HU-R8P7-90UZ
UXTQ-UYZK-79YT-6XYR

The Tester client key is 3D9AACA84BEC559A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment