SokoPro API Documentation (0.0.1)

Download OpenAPI specification:Download

This is a in progress documentation for SokoPro REST API.

Remarks:
- the endpoints of some download and upload operations have a different server providing streaming capabilities
- at some point, the integer type of id's (of projects, folders and files) will be deprecated in favor of string uuid's exclusively.

Authentication

BearerAuth

Security scheme type: HTTP
HTTP Authorization Scheme bearer
Bearer format "JWT"

OAuth2

This API uses OAuth2 with client_id and grant_type as request parameters

Security scheme type: OAuth2
authorizationCode OAuth Flow
Authorization URL: https://api.sokopro.fi/api/oauth2/authorize
Token URL: https://api.sokopro.fi/api/oauth2/token
Scopes:
  • full_access -

    Client will be able to do requests and act behalf of the user

password OAuth Flow
Token URL: https://api.sokopro.fi/api/oauth2/token
Scopes:
  • full_access -

    Client will be able to do requests and act behalf of the user

clientCredentials OAuth Flow
Token URL: https://api.sokopro.fi/api/oauth2/token
Scopes:
  • full_access -

    Client will be able to do requests and act behalf of the user

Authentication Resources

The authentication methods required for successful operation authentication.

Client to get access token

Can be used to get client_credentials or password_grant by defining grant_type to client_credentials or password_grant

Authorizations:
query Parameters
Query parameters
authorization_code (object) or client_credentials (object) or password_grant (object)

Query parameters to be used for token request. It's recommended to use authorization_code. Other grant types are supported for previous users.

Responses

200

After successful authentication return user specific token

403

User has passed incorect credentials or does not have access to this feature. See the response for more specific reason

422

Validation error. See the response for more specific reason

500

Unknown error

get /oauth2/token
https://api.sokopro.fi/api/oauth2/token

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "data":
    {
    }
}

Authorize

Authorize client

Authorizations:
query Parameters
response_type
required
string
Value: "code"

For the moment supported response_type is code

client_id
required
string
Example: client_id=exampleclientid

Registered client identifier

redirect_uri
required
string
Example: redirect_uri=httpspreviously.requested.redirect.address.com

Client's redirection endpoint, which has been added to the client during client registration

scope
required
string
Value: "full_access"

For the moment only supported scope is full_access

state
required
string

State value from client

Responses

200

After successful authentication return user specific token

403

User has passed incorect credentials or does not have access to this feature. See the response for more specific reason

422

Validation error. See the response for more specific reason

500

Unknown error

get /oauth2/authorize
https://api.sokopro.fi/api/oauth2/authorize

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "data":
    {
    }
}

Authorize

Authorize client

Authorizations:
query Parameters
response_type
required
string
Value: "code"

For the moment supported response_type is code

client_id
required
string

Registered client identifier

redirect_uri
required
string

Client's redirection endpoint, which has been added to the client during client registration

scope
required
string
Value: "full_access"

For the moment only supported scope is full_access

state
required
string

State value from client

Responses

200

After successful authentication return user specific token

403

User has passed incorect credentials or does not have access to this feature. See the response for more specific reason

422

Validation error. See the response for more specific reason

500

Unknown error

post /oauth2/authorize
https://api.sokopro.fi/api/oauth2/authorize

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "data":
    {
    }
}

Get information of current user

Specific information about the user

Authorizations:

Responses

200

Current user

400

Invalid ID supplied

404

Folder wasn't found or user didn't have access to given folder

500

Unknown error

get /oauth2/user-info
https://api.sokopro.fi/api/oauth2/user-info

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "username": "string",
  • "firstName": "string",
  • "lastName": "string",
  • "email": "string",
  • "firstTimeLogin": false,
  • "company": "string",
  • "avatar": "string",
  • "hasAcceptedTerms": false,
  • "termsVersion": 0,
  • "language":
    [
    ],
  • "federated": false,
  • "level": "string"
}

Verify validity of the token

Check validity of current token

Authorizations:

Responses

200

OK

400

Invalid token

403

Invalid token

500

Unknown error

get /oauth2/verify
https://api.sokopro.fi/api/oauth2/verify

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "data": "string"
}

Project

Basic project resource specific operations.

List all projects what user has

List all projects what user has

Authorizations:

Responses

200

List of user's projects or empty if there's none

get /project
https://api.sokopro.fi/api/project

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Information about single project

Get information about specific project

Authorizations:
path Parameters
projectId
required
integer <int64>

Id of the project as integer

Responses

200

successful operation, for the moment parent value points to incorrect folder and shouldn't be used for navigation

404

Project doesn't exist or user has no access to the project

500

Unknown error

get /project/{projectId}
https://api.sokopro.fi/api/project/{projectId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "projectId": 0,
  • "cover": "string",
  • "description": "string",
  • "metadata":
    [
    ],
  • "customerId": 0,
  • "salesRepresentive":
    {
    },
  • "printProvider": 0,
  • "notes": "string",
  • "integrations": true,
  • "notifyFollowing":
    [
    ],
  • "projectAdmins":
    [
    ],
  • "permission": true,
  • "addressDetails":
    {
    },
  • "customerName": "string",
  • "customerSalesRepresentative":
    {
    },
  • "projectType":
    [
    ],
  • "uuid": "string",
  • "name": "string",
  • "status": "string"
}

Project metadata schema

Get project's metadata schema which is useful as an example when saving uploaded files

Authorizations:
path Parameters
projectId
required
integer <int64>

Id of the project as integer

Responses

200

successful operation, for the moment parent value points to incorrect folder and shouldn't be used for navigation

500

Failed to retrieve project metadata for given project

get /project/{projectId}/metadata
https://api.sokopro.fi/api/project/{projectId}/metadata

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "project_id": 0,
  • "metadata":
    [
    ],
  • "created_at": "string",
  • "updated_at": 0,
  • "deleted_at": 0
}

Folders and files

Basic operations related to folder and file resources.

List folder content

List the content of the folder

Authorizations:
path Parameters
projectId
required
integer <int64>

Id of the project as integer

folderId
required
integer <int64>

Id of the folder as integer

Responses

200

Content of requested folder

404

Not found

422

Unprocessable Entity, usually caused by validation error

500
get /files/project/{projectId}/{folderId}
https://api.sokopro.fi/api/files/project/{projectId}/{folderId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "files":
    [
    ],
  • "node":
    {
    },
  • "path":
    [
    ],
  • "total": 0
}

Find revisions of given file

Return revision of the filer

Authorizations:
path Parameters
fileId
required
integer <int64>

If of file as integer

Responses

200

successful operation, for the moment parent value points to incorrect folder and shouldn't be used for navigation

400

Invalid ID supplied

404

Folder wasn't found or user didn't have access to given folder

get /files/{fileId}/revisions
https://api.sokopro.fi/api/files/{fileId}/revisions

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get latest revision of the given file

Return latest revision of requested file or error

Authorizations:
path Parameters
fileUuid
required
string

fileUuid of the requested file

Responses

200

successful operation, return information of the latest revision of the file

400

Bad Request

401

Unauthorized

404

Revision for given file can not be found

422

Unprocessable Entity, usually caused by validation error