1. Introduction

This document contains generated documentation for AMPnet project service. Project service contains all endpoints need to manage projects and organizations for AMPnet crowdfunding project. Source code is available on Github

2. Organization API

All requests need header: Authorization: Bearer JWT.

2.1. Create organization

Request
POST /organization HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Host: localhost:8080

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=image; filename=image.png
Content-Type: image/png

ImageData
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=request; filename=request.json
Content-Type: application/json

{"name":"Organization name","description":"Organization description"}
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 251

{
  "uuid" : "7fdeed83-02fd-4e5a-a084-ad5b6de262d4",
  "name" : "Organization name",
  "created_at" : "2020-09-18T10:30:14.582Z",
  "approved" : true,
  "documents" : [ ],
  "description" : "Organization description",
  "header_image" : "image link"
}

2.2. Get organization by id

Request
GET /organization/175d07c6-ad4f-4428-9f4a-a2847c80f6cd HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 422

{
  "uuid" : "175d07c6-ad4f-4428-9f4a-a2847c80f6cd",
  "name" : "test organization",
  "created_at" : "2020-09-18T10:30:14.403Z",
  "approved" : true,
  "documents" : [ {
    "id" : 4,
    "link" : "link",
    "name" : "name",
    "type" : "document/type",
    "size" : 100,
    "created_at" : "2020-09-18T10:30:14.412Z"
  } ],
  "description" : "Organization description",
  "header_image" : "Organization header image"
}

2.3. Get all organizations

To get a list of all organization, user must have a privilege: PrivilegeType.PRA_ORG. List of all organizations is pageable. Define size of the list using param: size and page number with param: page. List can be sorted using param: sort (e.g. sort=createdAt,desc).

Request
GET /organization?size=10&page=0&sort=createdAt%2Cdesc HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 822

{
  "organizations" : [ {
    "uuid" : "e7b20c22-4b84-48db-b877-61fec1914cfc",
    "name" : "test 3",
    "created_at" : "2020-09-18T10:30:14.252Z",
    "approved" : true,
    "description" : "Organization description",
    "header_image" : "Organization header image"
  }, {
    "uuid" : "bd3e2e89-b707-4135-8291-2e3c14bb280f",
    "name" : "test 2",
    "created_at" : "2020-09-18T10:30:14.246Z",
    "approved" : true,
    "description" : "Organization description",
    "header_image" : "Organization header image"
  }, {
    "uuid" : "0130fa73-b03b-427b-beeb-1cf28fd82362",
    "name" : "test organization",
    "created_at" : "2020-09-18T10:30:14.239Z",
    "approved" : true,
    "description" : "Organization description",
    "header_image" : "Organization header image"
  } ],
  "page" : 0,
  "total_pages" : 1
}

2.4. Get personal organizations

Request
GET /organization/personal HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 322

{
  "organizations" : [ {
    "uuid" : "e361b519-66ca-42ec-af10-5d1a592dd8b6",
    "name" : "test organization",
    "created_at" : "2020-09-18T10:30:13.904Z",
    "approved" : true,
    "description" : "Organization description",
    "header_image" : "Organization header image"
  } ],
  "page" : 0,
  "total_pages" : 1
}

2.5. Update organization

Request
POST /organization/6efe2b3a-fe45-4745-b02e-cdad91957d4f/updates HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Host: localhost:8080

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=request; filename=request.json
Content-Type: application/json

{"description":"Organization description"}
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=image; filename=image.png
Content-Type: image/png

ImageData
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 230

{
  "uuid" : "6efe2b3a-fe45-4745-b02e-cdad91957d4f",
  "name" : "test organization",
  "created_at" : "2020-09-18T10:30:13.718Z",
  "approved" : true,
  "description" : "Organization description",
  "header_image" : "image link"
}

2.6. Documents

2.6.1. Add document for organization

Request
POST /organization/0b69198e-4e1d-4f2e-bb67-ac9827f5c487/document HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Host: localhost:8080

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=file; filename=test.txt
Content-Type: text/plain

Some document data
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 141

{
  "id" : 1,
  "link" : "link",
  "name" : "test.txt",
  "type" : "text/plain",
  "size" : 18,
  "created_at" : "2020-09-18T10:30:12.946Z"
}

2.6.2. Remove organization document

Request
DELETE /organization/bbe8c020-0ed0-4a34-9ee1-8e0c6cbb956e/document/2 HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 3

{ }

2.7. Organization Invitation

2.7.1. Get a list of invitations

Request
GET /invites/me/ HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 170

{
  "organization_invites" : [ {
    "organization_uuid" : "d006b0fb-41aa-4fd3-9e94-e71aafb38cad",
    "organization_name" : "Test org",
    "role" : "ORG_MEMBER"
  } ]
}

2.7.2. Invite user to organization

Send invitation
Request
POST /invites/organization/b22763e1-bf7e-4317-be83-813130297936/invite HTTP/1.1
Content-Type: application/json
Content-Length: 65
Host: localhost:8080

{
  "email" : "invited@email.com",
  "role_type" : "ORG_MEMBER"
}
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 3

{ }
Failed to send invitation without organization admin role

User missing a privilege: OrganizationPrivilegeType.PW_USERS

Request
POST /invites/organization/50b4c7b9-9617-4fe4-9be0-10eac4af9b5f/invite HTTP/1.1
Content-Type: application/json
Content-Length: 65
Host: localhost:8080

{
  "email" : "invited@email.com",
  "role_type" : "ORG_MEMBER"
}
Response
HTTP/1.1 403 Forbidden
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Revoke invitation
Request
POST /invites/organization/e88429da-689e-4834-82c7-c6a416f4d439/invited@email.com/revoke HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 3

{ }

2.7.3. Accept invitation

Request
POST /invites/me/42dbf17c-5c9e-41b3-8b30-3a09e54f1f72/accept HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

2.7.4. Reject invitation

Request
POST /invites/me/d72e44d9-fe7d-4eee-bd1c-2ce89244f7fb/reject HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

2.7.5. Get a list of pending invitations

Request
GET /invites/organization/82108fe6-1aad-4665-b71f-d32f8a6e1f80 HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 145

{
  "pending_invites" : [ {
    "user_email" : "user@email.com",
    "role" : "ORG_MEMBER",
    "created_at" : "2020-09-18T10:30:17.753Z"
  } ]
}

2.8. Organization Members

2.8.1. List all members

Request
GET /organization/7b1bbd4d-f3d2-4562-a923-17b9d8461ce4/members HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 392

{
  "members" : [ {
    "uuid" : "260824e4-efc0-4b21-bbcd-16daf1067731",
    "first_name" : "ss",
    "last_name" : "ll",
    "role" : "ORG_MEMBER",
    "member_since" : "2020-09-18T10:30:19.207Z"
  }, {
    "uuid" : "b2d56e27-ce49-4bab-9cfe-f63019706f97",
    "first_name" : "first",
    "last_name" : "last",
    "role" : "ORG_ADMIN",
    "member_since" : "2020-09-18T10:30:19.218Z"
  } ]
}

2.8.2. Delete a member

Request
DELETE /organization/6be214e2-60af-4b2a-8858-5da40b2dc37e/members/2cf924a5-3f88-4ba6-82f0-7a6a39209be2 HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 3

{ }

2.8.3. Update organization role

Request
POST /organization/e461c1d6-3b87-4a89-b2a6-a6a7044aaba6/members HTTP/1.1
Content-Type: application/json
Content-Length: 89
Host: localhost:8080

{
  "member_uuid" : "9570ed5c-39b8-448f-bb55-8dd684302d84",
  "role_type" : "ORG_ADMIN"
}
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 3

{ }

3. Project API

All requests need header: Authorization: Bearer JWT.

3.1. Create project

3.1.1. Successfully create

Tags value is optional.

Request
POST /project HTTP/1.1
Content-Type: application/json
Content-Length: 467
Host: localhost:8080

{
  "organization_uuid" : "f9eaeb93-0e7c-438e-b537-f81cc501bb9a",
  "name" : "Das project",
  "description" : "description",
  "location" : {
    "lat" : 12.234,
    "long" : 23.432
  },
  "roi" : {
    "from" : 2.22,
    "to" : 7.77
  },
  "start_date" : "2020-09-18T10:30:16.192Z",
  "end_date" : "2020-10-18T10:30:16.192Z",
  "expected_funding" : 1000000,
  "currency" : "EUR",
  "min_per_user" : 1,
  "max_per_user" : 1000000,
  "active" : true,
  "tags" : null
}
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 476

{
  "uuid" : "2651fda4-6951-42fd-b43b-2c5d8c39cae9",
  "name" : "Das project",
  "description" : "description",
  "location" : {
    "lat" : 12.234,
    "long" : 23.432
  },
  "roi" : {
    "from" : 2.22,
    "to" : 7.77
  },
  "start_date" : "2020-09-18T10:30:16.192Z",
  "end_date" : "2020-10-18T10:30:16.192Z",
  "expected_funding" : 1000000,
  "currency" : "EUR",
  "min_per_user" : 1,
  "max_per_user" : 1000000,
  "main_image" : null,
  "active" : true,
  "tags" : [ ]
}

3.1.2. Cannot create project without privilege

User cannot create project without admin role in organization, privilege: OrganizationPrivilegeType.PW_PROJECT

Request
POST /project HTTP/1.1
Content-Type: application/json
Content-Length: 469
Host: localhost:8080

{
  "organization_uuid" : "96871f74-51f7-4bb0-b953-dfd0c85b079a",
  "name" : "Error project",
  "description" : "description",
  "location" : {
    "lat" : 12.234,
    "long" : 23.432
  },
  "roi" : {
    "from" : 2.22,
    "to" : 7.77
  },
  "start_date" : "2020-09-18T10:30:17.308Z",
  "end_date" : "2020-10-18T10:30:17.308Z",
  "expected_funding" : 1000000,
  "currency" : "EUR",
  "min_per_user" : 1,
  "max_per_user" : 1000000,
  "active" : true,
  "tags" : null
}
Response
HTTP/1.1 403 Forbidden
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

3.2. Get all projects for organization

List of all projects is pageable. Define size of the list using param: size and page number with param: page. List can be sorted using param: sort (e.g. sort=name,asc).

Request
GET /public/project/organization/00d24711-a029-479f-8cb0-53794b23e1a4?size=10&page=0&sort=name%2Casc HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 1592

{
  "projects" : [ {
    "uuid" : "0dd672ef-c549-44c9-bab4-b72bf6514b7e",
    "name" : "Project 1",
    "description" : "description",
    "location" : {
      "lat" : 0.1,
      "long" : 1.0
    },
    "roi" : {
      "from" : 4.44,
      "to" : 9.99
    },
    "start_date" : "2020-09-18T10:30:20.198Z",
    "end_date" : "2020-10-18T10:30:20.198Z",
    "expected_funding" : 10000000,
    "currency" : "EUR",
    "min_per_user" : 10,
    "max_per_user" : 10000,
    "main_image" : null,
    "active" : true,
    "tags" : [ ]
  }, {
    "uuid" : "136bcc41-0404-4649-a153-85b3e96d1594",
    "name" : "Project 2",
    "description" : "description",
    "location" : {
      "lat" : 0.1,
      "long" : 1.0
    },
    "roi" : {
      "from" : 4.44,
      "to" : 9.99
    },
    "start_date" : "2020-09-18T10:30:20.212Z",
    "end_date" : "2020-10-18T10:30:20.212Z",
    "expected_funding" : 10000000,
    "currency" : "EUR",
    "min_per_user" : 10,
    "max_per_user" : 10000,
    "main_image" : null,
    "active" : true,
    "tags" : [ ]
  }, {
    "uuid" : "e7153a18-5d46-4dff-b4d2-31d320c089e9",
    "name" : "Project 3",
    "description" : "description",
    "location" : {
      "lat" : 0.1,
      "long" : 1.0
    },
    "roi" : {
      "from" : 4.44,
      "to" : 9.99
    },
    "start_date" : "2020-09-18T10:30:20.218Z",
    "end_date" : "2020-10-18T10:30:20.218Z",
    "expected_funding" : 10000000,
    "currency" : "EUR",
    "min_per_user" : 10,
    "max_per_user" : 10000,
    "main_image" : null,
    "active" : true,
    "tags" : [ ]
  } ],
  "page" : 0,
  "total_pages" : 1
}

3.3. Update

All values are optional. Only provided values will be updated. For list values: tags and news, new list overrides old values.

Request
PUT /project/33ae2e42-c40a-4401-8b17-f05caa72555b HTTP/1.1
Content-Type: application/json
Content-Length: 226
Host: localhost:8080

{
  "name" : "new name",
  "description" : "description",
  "location" : {
    "lat" : 22.1,
    "long" : 0.3
  },
  "roi" : {
    "from" : 1.11,
    "to" : 5.55
  },
  "active" : false,
  "tags" : [ "tag" ],
  "news" : null
}
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 529

{
  "uuid" : "33ae2e42-c40a-4401-8b17-f05caa72555b",
  "name" : "new name",
  "description" : "description",
  "location" : {
    "lat" : 22.1,
    "long" : 0.3
  },
  "roi" : {
    "from" : 1.11,
    "to" : 5.55
  },
  "start_date" : "2020-09-18T10:30:16.56Z",
  "end_date" : "2020-10-18T10:30:16.56Z",
  "expected_funding" : 10000000,
  "currency" : "EUR",
  "min_per_user" : 10,
  "max_per_user" : 10000,
  "main_image" : null,
  "active" : false,
  "tags" : [ "tag" ],
  "gallery" : [ ],
  "news" : [ ],
  "documents" : [ ]
}

3.4. Documents

3.4.1. Add document for project

Request
POST /project/755aec8b-8b5a-4e67-a5a6-4e4d2f12016c/document HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Host: localhost:8080

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=file; filename=test.txt
Content-Type: text/plain

Some document data
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 141

{
  "id" : 5,
  "link" : "link",
  "name" : "test.txt",
  "type" : "text/plain",
  "size" : 18,
  "created_at" : "2020-09-18T10:30:14.827Z"
}

3.4.2. Remove project document

Request
DELETE /project/1cbe6447-2ede-4d0f-9b66-156cd34f354e/document/6 HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 3

{ }

3.5. Images

3.5.1. Add main image

Request
POST /project/93416202-34e8-4a83-8c9d-e2beceafff06/image/main HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Host: localhost:8080

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=image; filename=image.png
Content-Type: image/png

ImageData
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 3

{ }
Request
POST /project/36dd87e0-b5b1-48b5-b7fb-9177a12a17ce/image/gallery HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Host: localhost:8080

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=image; filename=image.png
Content-Type: image/png

ImageData
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 3

{ }
Request
DELETE /project/25e3cee8-846a-4268-a402-b2eef04a015c/image/gallery HTTP/1.1
Content-Type: application/json
Content-Length: 35
Host: localhost:8080

{
  "images" : [ "image-link-1" ]
}
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 3

{ }

3.6. Updates

3.6.1. Get

Request
GET /public/project/16017b74-4cdc-4ab8-9e84-1c6624fd7f8e/updates?size=10&page=0&sort=createdAt%2Cdesc HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 462

{
  "updates" : [ {
    "id" : 4,
    "project_uuid" : "16017b74-4cdc-4ab8-9e84-1c6624fd7f8e",
    "title" : "Webinar",
    "content" : "Fundamentals of software architecture",
    "author" : "Some user",
    "date" : "2020-09-18T10:30:19.756Z"
  }, {
    "id" : 3,
    "project_uuid" : "16017b74-4cdc-4ab8-9e84-1c6624fd7f8e",
    "title" : "Some title",
    "content" : "Some content",
    "author" : "Some user",
    "date" : "2020-09-18T10:30:19.752Z"
  } ]
}

3.6.2. Create

Request
POST /project/9a3fcf14-ba9c-4263-860d-0ab0247ab5f1/updates HTTP/1.1
Content-Type: application/json
Content-Length: 58
Host: localhost:8080

{
  "title" : "Some title",
  "content" : "Some content"
}
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 195

{
  "id" : 1,
  "project_uuid" : "9a3fcf14-ba9c-4263-860d-0ab0247ab5f1",
  "title" : "Some title",
  "content" : "Some content",
  "author" : "First Last",
  "date" : "2020-09-18T10:30:19.543Z"
}

3.6.3. Delete

Request
DELETE /project/5eb4d06e-d322-4e34-b7b6-7bee5bccf3d9/updates/2 HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

4. Public API

4.1. Get project

Request
GET /public/project/9c886a41-43ba-435d-b011-0db1819bcdda HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 525

{
  "uuid" : "9c886a41-43ba-435d-b011-0db1819bcdda",
  "name" : "My project",
  "description" : "description",
  "location" : {
    "lat" : 0.1,
    "long" : 1.0
  },
  "roi" : {
    "from" : 4.44,
    "to" : 9.99
  },
  "start_date" : "2020-09-18T10:30:19.862Z",
  "end_date" : "2020-10-18T10:30:19.862Z",
  "expected_funding" : 10000000,
  "currency" : "EUR",
  "min_per_user" : 10,
  "max_per_user" : 10000,
  "main_image" : null,
  "active" : true,
  "tags" : [ ],
  "gallery" : [ ],
  "news" : [ ],
  "documents" : [ ]
}

4.2. Get all projects

List of all projects is pageable. Define size of the list using param: size and page number with param: page. List can be sorted using param: sort (e.g. sort=createdAt,desc).

Request
GET /public/project?size=10&page=0&sort=createdAt%2Cdesc HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 1086

{
  "projects" : [ {
    "uuid" : "07ed7904-5d86-4fe3-9362-ecbb0e901938",
    "name" : "Second project",
    "description" : "description",
    "location" : {
      "lat" : 0.1,
      "long" : 1.0
    },
    "roi" : {
      "from" : 4.44,
      "to" : 9.99
    },
    "start_date" : "2020-09-18T10:30:20.682Z",
    "end_date" : "2020-10-18T10:30:20.682Z",
    "expected_funding" : 10000000,
    "currency" : "EUR",
    "min_per_user" : 10,
    "max_per_user" : 10000,
    "main_image" : null,
    "active" : true,
    "tags" : [ ]
  }, {
    "uuid" : "628baf68-3e8e-4eb7-adbc-c865c9fa66f2",
    "name" : "My project",
    "description" : "description",
    "location" : {
      "lat" : 0.1,
      "long" : 1.0
    },
    "roi" : {
      "from" : 4.44,
      "to" : 9.99
    },
    "start_date" : "2020-09-18T10:30:20.668Z",
    "end_date" : "2020-10-18T10:30:20.668Z",
    "expected_funding" : 10000000,
    "currency" : "EUR",
    "min_per_user" : 10,
    "max_per_user" : 10000,
    "main_image" : null,
    "active" : true,
    "tags" : [ ]
  } ],
  "page" : 0,
  "total_pages" : 1
}

4.3. Get active projects

List of active projects is pageable. Define size of the list using param: size and page number with param: page. List can be sorted using param: sort (e.g. sort=createdAt,desc).

Request
GET /public/project/active?size=10&page=0&sort=createdAt%2Cdesc HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 911

{
  "projects_with_wallet" : [ {
    "project" : {
      "uuid" : "cbb2fd16-339d-4ca4-8d7c-f279e3a1e571",
      "name" : "Active project",
      "description" : "description",
      "location" : {
        "lat" : 0.1,
        "long" : 1.0
      },
      "roi" : {
        "from" : 4.44,
        "to" : 9.99
      },
      "start_date" : "2020-09-17T10:30:19.992Z",
      "end_date" : "2020-10-18T10:30:19.992Z",
      "expected_funding" : 10000000,
      "currency" : "EUR",
      "min_per_user" : 10,
      "max_per_user" : 10000,
      "main_image" : null,
      "active" : true,
      "tags" : [ ]
    },
    "wallet" : {
      "uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "owner" : "cbb2fd16-339d-4ca4-8d7c-f279e3a1e571",
      "activation_data" : "activation data",
      "type" : "PROJECT",
      "currency" : "EUR",
      "hash" : "walllet hash"
    }
  } ],
  "page" : 0,
  "total_pages" : 1
}

4.4. Count all active projects

Request
GET /public/project/active/count HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 27

{
  "active_projects" : 1
}

4.5. Get projects by tags

List of all projects is pageable. Define size of the list using param: size and page number with param: page. List can be sorted using param: sort (e.g. sort=createdAt,desc).

Request
GET /public/project?tags=wind&tags=green&size=10&page=0&sort=createdAt%2Cdesc HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 584

{
  "projects" : [ {
    "uuid" : "d6363d7b-c916-40fc-b1c7-9fba833f5bdc",
    "name" : "Project 2",
    "description" : "description",
    "location" : {
      "lat" : 0.1,
      "long" : 1.0
    },
    "roi" : {
      "from" : 4.44,
      "to" : 9.99
    },
    "start_date" : "2020-09-18T10:30:20.326Z",
    "end_date" : "2020-10-18T10:30:20.326Z",
    "expected_funding" : 10000000,
    "currency" : "EUR",
    "min_per_user" : 10,
    "max_per_user" : 10000,
    "main_image" : null,
    "active" : true,
    "tags" : [ "green", "wind" ]
  } ],
  "page" : 0,
  "total_pages" : 1
}

4.6. Get all project tags

Request
GET /public/project/tags HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 43

{
  "tags" : [ "solar", "green", "wind" ]
}

4.7. Get Project Updates

Request
GET /public/project/16017b74-4cdc-4ab8-9e84-1c6624fd7f8e/updates?size=10&page=0&sort=createdAt%2Cdesc HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 462

{
  "updates" : [ {
    "id" : 4,
    "project_uuid" : "16017b74-4cdc-4ab8-9e84-1c6624fd7f8e",
    "title" : "Webinar",
    "content" : "Fundamentals of software architecture",
    "author" : "Some user",
    "date" : "2020-09-18T10:30:19.756Z"
  }, {
    "id" : 3,
    "project_uuid" : "16017b74-4cdc-4ab8-9e84-1c6624fd7f8e",
    "title" : "Some title",
    "content" : "Some content",
    "author" : "Some user",
    "date" : "2020-09-18T10:30:19.752Z"
  } ]
}

4.8. Search organizations and projects by name

Request
GET /public/search?name=Pro&size=10&page=0 HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 1349

{
  "organizations" : [ {
    "uuid" : "96117285-a497-4263-86bb-932d737f5cec",
    "name" : "The Prospect Organization",
    "created_at" : "2020-09-18T10:30:18.691Z",
    "approved" : true,
    "description" : "Organization description",
    "header_image" : "Organization header image"
  } ],
  "projects" : [ {
    "uuid" : "0ab139fb-ea70-4be2-a44e-75b306effb85",
    "name" : "The first project",
    "description" : "description",
    "location" : {
      "lat" : 0.1,
      "long" : 1.0
    },
    "roi" : {
      "from" : 4.44,
      "to" : 9.99
    },
    "start_date" : "2020-09-18T10:30:18.711Z",
    "end_date" : "2020-10-18T10:30:18.711Z",
    "expected_funding" : 10000000,
    "currency" : "EUR",
    "min_per_user" : 10,
    "max_per_user" : 10000,
    "main_image" : null,
    "active" : true,
    "tags" : [ ]
  }, {
    "uuid" : "2bebafd3-63ba-46eb-b2b8-91f97ffa8423",
    "name" : "The projcccp",
    "description" : "description",
    "location" : {
      "lat" : 0.1,
      "long" : 1.0
    },
    "roi" : {
      "from" : 4.44,
      "to" : 9.99
    },
    "start_date" : "2020-09-18T10:30:18.733Z",
    "end_date" : "2020-10-18T10:30:18.733Z",
    "expected_funding" : 10000000,
    "currency" : "EUR",
    "min_per_user" : 10,
    "max_per_user" : 10000,
    "main_image" : null,
    "active" : true,
    "tags" : [ ]
  } ]
}