Skip to content
Gab0rB edited this page Jun 23, 2016 · 32 revisions

Module User

URL method description more
Images
/image/{imageName} get
/image/{imageName}/{width}/{height} get
Planting
/simplePlantProposalForTrees/{amountOfTrees} get
/simpleDonateTrees post
/plantProposal/{targetedPrice} get
/donateTrees post
/plantSelf post
Projects
/reports/activeProjects?page=0&size=2 get
/projects/search/name/{projectName} get
/projects/search/name/extended/{projectName} get
/project/image/{projectName}/{imageName} get
/project/image/{projectName}/{imageName}/{width}/{height} get
CO2-Report
/reports/co2 get
Rankings
/ranking/bestUser?page=0&size=5 get
/ranking/lastCreatedUser get
/ranking/bestOrgType/{organizationType}?page=0&size=5 get
/ranking/lastPlantedTrees get
/ranking/bestTeam?page=0&size=3 get
/ranking/bestUserFromTimeRange/{timeRange} get
Planted trees
/tree/{id} get
/trees?page=0&size=2 get
/trees/owner/{ownerId}?page=0&size=2 get
/trees/project/{projectId}?page=0&size=2 get
Certificates
/certificate/search/{certificateNumber} get
/certificate/create get
Carts
/carts/search/short/{userId} get
Project offer
/project/offer post
Gifts
/gift/search/consignor/{userId} get
/gift/search/recipient/{userId} get
/gift/create post
/gift/pdf get
Abos
/abo/search/{userId} get
/abo/create post
/abo/edit post
/abo/cancel post

Article Manager

URL description more
/articles/{articleType}?page=0&size=5 get
/reports/article/{articleId} get
/article/image/{articleId}/{imageName} get
/article/image/{articleId}/{imageName}/{width}/{height} get

Simple plant proposal

/simplePlantProposalForTrees/5

{
  "targetAmountOfTrees": 5,
  "actualAmountOfTrees": 5,
  "actualPrice": 2665,
  "plantItems": [
    {
      "treeType": "Birke",
      "amount": 4,
      "treePrice": 539,
      "projectName": "Project 9 von Philipp"
    },
    {
      "treeType": "Buche",
      "amount": 1,
      "treePrice": 509,
      "projectName": "Project 3 von Johannes"
    }
  ]
}

back to overview

Simple donate trees

/simpleDonateTree

the RequestBody should contain an object in the form of the example below: 
{
  "userId": 1,
  "targetAmountOfTrees": 10,
  "actualAmountOfTrees": 10,
  "actualPrice": 4797,
  "plantItems": [
    {
      "treeType": "Kiefer",
      "amount": 7,
      "treePrice": 570,
      "projectName": "Project 6 von admin"
    },
    {
      "treeType": "Buche",
      "amount": 1,
      "treePrice": 221,
      "projectName": "Project 5 von admin"
    }
  ]
}

back to overview

#Plant proposal /plantProposal/10000

{
  "targetPrice": 10000,
  "actualPrice": 9984,
  "projects": {
    "Project 6 von admin": {
      "plantItems": {
        "Buche": {
          "amount": 1,
          "treePrice": 223
        },
        "Birke": {
          "amount": 1,
          "treePrice": 511
        },
        "Kiefer": {
          "amount": 12,
          "treePrice": 570
        }
      }
    },
    "Project 7 von Johannes": {
      "plantItems": {
        "Buche": {
          "amount": 1,
          "treePrice": 360
        },
        "Birke": {
          "amount": 1,
          "treePrice": 179
        },
        "Kiefer": {
          "amount": 1,
          "treePrice": 429
        }
      }
    }
  }
}

back to overview

#donate trees /donateTrees

The RequestBody should contain an object in the form of the example below:
{
  "userId": 1,
  "targetPrice": 10000,
  "actualPrice": 9984,
  "projects": {
    "Project 6 von admin": {
      "plantItems": {
        "Buche": {
          "amount": 1,
          "treePrice": 223
        },
        "Birke": {
          "amount": 1,
          "treePrice": 511
        },
        "Kiefer": {
          "amount": 12,
          "treePrice": 570
        }
      }
    },
    "Project 7 von Johannes": {
      "plantItems": {
        "Buche": {
          "amount": 1,
          "treePrice": 360
        },
        "Birke": {
          "amount": 1,
          "treePrice": 179
        },
        "Kiefer": {
          "amount": 1,
          "treePrice": 429
        }
      }
    }
  }
}

back to overview

#Self planted tree /plantSelf

The RequestBody should contain an object in the form of the example below:
{
  "owner":"Adam",
  "plantedOn":1433970341881,
  "amount":10,
  "treeType":"wood",
  "description":"I planted a tree by myself in my garden.",
  "longitude":1.0,
  "latitude":2.0
}

back to overview

#Project overview /reports/activeProjects?page=0&size=2

{
  "content": [
    {
      "projectId": 4,
      "projectName": "Project 3 von Johannes",
      "projectImageFileName": "project4.jpg",
      "description": "dksgny.d, mdfgnmn snfad,ng ,ydfng. ,ydfgnk.<sngdk< sglkbsnglkdfnksghnl<k njdjg nsgyö< ögn kl< bsflkjsb gkjs kgs ns< lödgksndlkgnöd<kl dykdyn ökd ökshö<g dysh ögskgös Hskg khoglksg",
      "longitude": 13.607287,
      "latitude": 52.462654,
      "amountOfMaximumTreesToPlant": 1180,
      "amountOfPlantedTrees": 0,
      "active": true
    },
    {
      "projectId": 6,
      "projectName": "Project 5 von Micha",
      "projectImageFileName": "project6.jpg",
      "description": "dksgny.d, mdfgnmn snfad,ng ,ydfng. ,ydfgnk.<sngdk< sglkbsnglkdfnksghnl<k njdjg nsgyö< ögn kl< bsflkjsb gkjs kgs ns< lödgksndlkgnöd<kl dykdyn ökd ökshö<g dysh ögskgös Hskg khoglksg",
      "longitude": 13.607287,
      "latitude": 52.462654,
      "amountOfMaximumTreesToPlant": 532,
      "amountOfPlantedTrees": 0,
      "active": true
    }
  ],
  "last": false,
  "totalElements": 4,
  "totalPages": 2,
  "size": 2,
  "number": 0,
  "sort": null,
  "first": true,
  "numberOfElements": 2
}

back to overview

#Project details /projects/search/name/Project 1 von admin

{
  "projectId": 1,
  "projectName": "Project 1 von admin",
  "projectImageFileName": "project1.jpg",
  "description": "dksgny.d, mdfgnmn snfad,ng ,ydfng. ,ydfgnk.<sngdk< sglkbsnglkdfnksghnl<k njdjg nsgyö< ögn kl< bsflkjsb gkjs kgs ns< lödgksndlkgnöd<kl dykdyn ökd ökshö<g dysh ögskgös Hskg khoglksg",
  "longitude": 13.607287,
  "latitude": 52.462654,
  "amountOfMaximumTreesToPlant": 767,
  "amountOfPlantedTrees": 0,
  "active": true
}

back to overview

#Extended project details /projects/search/name/extended/Project 1 von admin

{
  "projectReportData": {
    "projectId": 1,
    "projectName": "Project 1 von admin",
    "projectImageFileName": "project1.jpg",
    "description": "dksgny.d, mdfgnmn snfad,ng ,ydfng. ,ydfgnk.<sngdk< sglkbsnglkdfnksghnl<k njdjg nsgyö< ögn kl< bsflkjsb gkjs kgs ns< lödgksndlkgnöd<kl dykdyn ökd ökshö<g dysh ögskgös Hskg khoglksg",
    "longitude": 13.607287,
    "latitude": 52.462654,
    "amountOfMaximumTreesToPlant": 767,
    "amountOfPlantedTrees": 0,
    "active": true
  },
  "images": [
    {
      "title": "image 1",
      "description": " image description 1",
      "imageFileName": "project.1jpg",
      "date": 100000000
    },
    {
      "title": "image 2",
      "description": " image description 2",
      "imageFileName": "project.2jpg",
      "date": 200000000
    },
    {
      "title": "image 3",
      "description": " image description 3",
      "imageFileName": "project.3jpg",
      "date": 300000000
    },
    {
      "title": "image 4",
      "description": " image description 4",
      "imageFileName": "project.4jpg",
      "date": 400000000
    },
    {
      "title": "image 5",
      "description": " image description 5",
      "imageFileName": "project.5jpg",
      "date": 500000000
    }
  ]
}

back to overview

CO2 Report

/reports/co2

{
  "treesCount": 142500,
  "co2": 114963.4341336833
}

back to overview

best user ranking

/ranking/bestUser?page=0&size=5

{
  "content": [
    {
      "name": "Philipp",
      "amount": 21000,
      "co2Saved": 16935.220294464114
    },
    {
      "name": "Axl",
      "amount": 19500,
      "co2Saved": 15725.561701974526
    },
    {
      "name": "Sven",
      "amount": 18000,
      "co2Saved": 14523.801479545782
    },
    {
      "name": "Christian",
      "amount": 16500,
      "co2Saved": 13316.46593706305
    },
    {
      "name": "Micha",
      "amount": 15000,
      "co2Saved": 12105.87812461676
    }
  ],
  "last": false,
  "totalElements": 10,
  "totalPages": 2,
  "size": 5,
  "number": 0,
  "sort": null,
  "first": true,
  "numberOfElements": 5
}

back to overview

last created user

/ranking/lastCreatedUser

 {
  "0": {
    "name": "admin",
    "date": "07.06.2015",
    "time": "11:39:08"
  },
  "1": {
    "name": "Martin",
    "date": "07.06.2014",
    "time": "11:39:08"
  },
  "2": {
    "name": "Sebastian",
    "date": "07.06.2013",
    "time": "11:39:08"
  },
  "3": {
    "name": "Johannes",
    "date": "07.06.2012",
    "time": "11:39:08"
  },
  "4": {
    "name": "Gabor",
    "date": "08.06.2011",
    "time": "11:39:08"
  },
  "5": {
    "name": "Micha",
    "date": "08.06.2010",
    "time": "11:39:08"
  },
  "6": {
    "name": "Christian",
    "date": "08.06.2009",
    "time": "11:39:08"
  },
  "7": {
    "name": "Sven",
    "date": "08.06.2008",
    "time": "11:39:08"
  },
  "8": {
    "name": "Axl",
    "date": "09.06.2007",
    "time": "11:39:08"
  },
  "9": {
    "name": "Philipp",
    "date": "09.06.2006",
    "time": "11:39:08"
  }
}

back to overview

best organization type

/ranking/bestOrgType/0?page=0&size=5

{
  "content": [
    {
      "name": "Philipp",
      "amount": 21000,
      "co2Saved": 16935.245130656604
    },
    {
      "name": "Axl",
      "amount": 19500,
      "co2Saved": 15725.584764153265
    },
    {
      "name": "Sven",
      "amount": 18000,
      "co2Saved": 14523.822779294067
    },
    {
      "name": "Christian",
      "amount": 16500,
      "co2Saved": 13316.485466204433
    },
    {
      "name": "Micha",
      "amount": 15000,
      "co2Saved": 12105.895878381654
    }
  ],
  "last": false,
  "totalElements": 10,
  "totalPages": 2,
  "size": 5,
  "number": 0,
  "sort": null,
  "first": true,
  "numberOfElements": 5
}

back to overview

#Last planted trees /ranking/lastPlantedTrees

{
  "0": {
    "name": "Philipp",
    "amount": 19,
    "projectName": "Project 10 von Philipp"
  },
  "1": {
    "name": "Axl",
    "amount": 18,
    "projectName": "Project 10 von Philipp"
  },
  "2": {
    "name": "Sven",
    "amount": 17,
    "projectName": "Project 10 von Philipp"
  },
  "3": {
    "name": "Christian",
    "amount": 16,
    "projectName": "Project 9 von Axl"
  },
  "4": {
    "name": "Micha",
    "amount": 15,
    "projectName": "Project 9 von Axl"
  },
  "5": {
    "name": "Gabor",
    "amount": 14,
    "projectName": "Project 9 von Axl"
  },
  "6": {
    "name": "Johannes",
    "amount": 13,
    "projectName": "Project 8 von Sven"
  },
  "7": {
    "name": "Sebastian",
    "amount": 12,
    "projectName": "Project 8 von Sven"
  },
  "8": {
    "name": "Martin",
    "amount": 11,
    "projectName": "Project 8 von Sven"
  },
  "9": {
    "name": "admin",
    "amount": 10,
    "projectName": "Project 7 von Christian"
  }
}

back to overview

#Best teams /ranking/bestTeam?page=0&size=3

{
  "content": [
    {
      "name": "Team 3",
      "amount": 58500,
      "co2Saved": 241.6482538470963
    },
    {
      "name": "Team 2",
      "amount": 45000,
      "co2Saved": 185.95688021468573
    },
    {
      "name": "Team 1",
      "amount": 31500,
      "co2Saved": 130.14394006070935
    }
  ],
  "totalPages": 1,
  "totalElements": 3,
  "last": true,
  "size": 3,
  "number": 0,
  "sort": null,
  "first": true,
  "numberOfElements": 3
}

back to overview

#Best user for time range /ranking/bestUserFromTimeRange/year

{
  "0": {
    "name": "Philipp",
    "amount": 17145,
    "co2Saved": null
  },
  "1": {
    "name": "Axl",
    "amount": 15920,
    "co2Saved": null
  },
  "2": {
    "name": "Sven",
    "amount": 14695,
    "co2Saved": null
  },
  "3": {
    "name": "Christian",
    "amount": 13470,
    "co2Saved": null
  },
  "4": {
    "name": "Micha",
    "amount": 12245,
    "co2Saved": null
  },
  "5": {
    "name": "Gabor",
    "amount": 11020,
    "co2Saved": null
  },
  "6": {
    "name": "Johannes",
    "amount": 9795,
    "co2Saved": null
  },
  "7": {
    "name": "Sebastian",
    "amount": 8570,
    "co2Saved": null
  },
  "8": {
    "name": "Martin",
    "amount": 7345,
    "co2Saved": null
  },
  "9": {
    "name": "admin",
    "amount": 6130,
    "co2Saved": null
  }
}

back to overview

#Get planted tree by id /tree/1

{
  "id": 1,
  "amount": 0,
  "longitude": 0,
  "latitude": 0,
  "submittedOn": 0,
  "plantedOn": 1465295431061,
  "description": null,
  "owner": {
    "name": "admin"
  },
  "treeType": {
    "name": "Buche"
  }
}

back to overview

#Get planted trees by page request /trees?page=0&size=2

{
  "totalElements": 15000,
  "totalPages": 7500,
  "numberOfElements": 2,
  "sort": [
    {
      "direction": "DESC",
      "property": "plantedOn",
      "ignoreCase": false,
      "nullHandling": "NATIVE",
      "ascending": false
    }
  ],
  "last": false,
  "first": true,
  "content": [
    {
      "id": 1,
      "amount": 0,
      "longitude": 0,
      "latitude": 0,
      "submittedOn": 0,
      "plantedOn": 1465295431061,
      "description": null,
      "owner": {
        "name": "admin"
      },
      "treeType": {
        "name": "Buche"
      }
    },
    {
      "id": 2,
      "amount": 1,
      "longitude": 1,
      "latitude": 1,
      "submittedOn": 0,
      "plantedOn": 1465294431061,
      "description": null,
      "owner": {
        "name": "Martin"
      },
      "treeType": {
        "name": "Kiefer"
      }
    }
  ]
}

back to overview

#Get planted trees by owner id /trees/owner/1?page=0&size=2

{
  "totalElements": 1500,
  "totalPages": 750,
  "numberOfElements": 2,
  "sort": [
    {
      "direction": "DESC",
      "property": "plantedOn",
      "ignoreCase": false,
      "nullHandling": "NATIVE",
      "ascending": false
    }
  ],
  "last": false,
  "first": true,
  "content": [
    {
      "id": 1,
      "amount": 0,
      "longitude": 0,
      "latitude": 0,
      "submittedOn": 0,
      "plantedOn": 1465303088506,
      "description": null,
      "owner": {
        "name": "admin"
      },
      "treeType": {
        "name": "Buche"
      }
    },
    {
      "id": 11,
      "amount": 10,
      "longitude": 10,
      "latitude": 10,
      "submittedOn": 0,
      "plantedOn": 1465293088506,
      "description": null,
      "owner": {
        "name": "admin"
      },
      "treeType": {
        "name": "Default"
      }
    }
  ]
}

back to overview

#Get planted trees by project id /trees/project/1?page=0&size=2

{
  "totalElements": 1500,
  "totalPages": 750,
  "numberOfElements": 2,
  "sort": [
    {
      "direction": "DESC",
      "property": "plantedOn",
      "ignoreCase": false,
      "nullHandling": "NATIVE",
      "ascending": false
    }
  ],
  "last": false,
  "first": true,
  "content": [
    {
      "id": 1,
      "amount": 0,
      "longitude": 0,
      "latitude": 0,
      "submittedOn": 0,
      "plantedOn": 1465303088506,
      "description": null,
      "owner": {
        "name": "admin"
      },
      "treeType": {
        "name": "Buche"
      }
    },
    {
      "id": 2,
      "amount": 1,
      "longitude": 1,
      "latitude": 1,
      "submittedOn": 0,
      "plantedOn": 1465302088506,
      "description": null,
      "owner": {
        "name": "Martin"
      },
      "treeType": {
        "name": "Kiefer"
      }
    }
  ]
}

back to overview

#Get trees by certificate number /certificate/search/1.0-0

{
 "0": {
    "id": 1,
    "amount": 0,
    "longitude": 0,
    "latitude": 0,
    "submittedOn": 0,
    "plantedOn": 1465846768875,
    "description": null,
    "owner": {
      "name": "admin"
    },
    "treeType": {
      "name": "Buche"
    }
  }
}

back to overview

#Create certificate PDF /certificate/create

The RequestBody should contain an object in the form of the example below:
{
  "userId":1,
  "text":"blabla",
  "cartIds":[1]
}

back to overview

#Search carts short view /carts/search/short/1

{
  "0": {
    "id": 1,
    "timeStamp": null,
    "treeCount": 2,
    "totalPrice": 4
  }
}

back to overview

#Project offer /project/offer

The RequestBody should contain an object in the form of the example below:
(empty fields are optional, filled ones are mandatory)
{
  "userId": "",
  "first": "",
  "name": "Wurst",
  "mail": "hans.wurst@daundort.de",
  "location": "da und dort",
  "size": "1m²",
  "owner": "Wurst Hans",
  "afforestation": true,
  "purpose": "",
  "selling": true,
  "leasing": false,
  "lease": "",
  "comment": "",
}

back to overview

#Gifts by consignor /gift/search/consignor/1

{
  "0": {
    "consignor": {
      "name": "admin"
    },
    "recipient": {
      "name": "Philipp"
    },
    "code": {
      "code": "RTWB-VVAA-VV6A-GAMB"
    },
    "status": "REDEEMED"
  }
}

back to overview

#Gifts by recipient /gift/search/recipient/1

{
  "0": {
    "consignor": {
      "name": "Philipp"
    },
    "recipient": {
      "name": "admin"
    },
    "code": {
      "code": "ESRK-44UU-44XU-XMBB"
    },
    "status": "REDEEMED"
  }
}

back to overview

#Create gift /gift/create

The RequestBody should contain an object in the form of the example below:
{
  "userId": 1,
  "targetPrice": 10000,
  "actualPrice": 9984,
  "projects": {
    "Project 6 von admin": {
      "plantItems": {
        "Buche": {
          "amount": 1,
          "treePrice": 223
        },
        "Birke": {
          "amount": 1,
          "treePrice": 511
        },
        "Kiefer": {
          "amount": 12,
          "treePrice": 570
        }
      }
    },
    "Project 7 von Johannes": {
      "plantItems": {
        "Buche": {
          "amount": 1,
          "treePrice": 360
        },
        "Birke": {
          "amount": 1,
          "treePrice": 179
        },
        "Kiefer": {
          "amount": 1,
          "treePrice": 429
        }
      }
    }
  }
}

back to overview

#Create PDF for gift /gift/pdf

The HTTP Request needs a RequestParam giftId.

back to overview

#Abos by user /abo/search/5

{
  "0": {
    "id": 1,
    "amount": 1,
    "period": "WEEKLY",
    "timeStamp": 1466708653414,
    "last": null,
    "active": true
  }
}

back to overview

#Create abo /abo/create

The RequestBody should contain an object in the form of the example below:
{
  "amount":1,
  "period":"WEEKLY",
  "plantBag":{
    "userId":1,
    "targetPrice":0,
    "actualPrice":0,
    "projects":{
    "Project A":{
    "plantItems":{
      "wood":{
      "amount":3,
      "treePrice":300
          }
        }
      }
    }
  }
}

back to overview

#Edit abo /abo/edit

The RequestBody should contain an object in the form of the example below:
{
  "aboId":2,
  "amount":3,
  "period":"MONTHLY"
}

back to overview

#Cancel abo /abo/cancel

The HTTP Request needs a RequestParam aboId.

back to overview


#Articles by type /articles/BLOG?page=0&size=5

{
  "content": [
    {
      "id": 100,
      "title": "this is article nr 4 from BLOG article",
      "intro": "this is an article about BLOG",
      "imageFileName": "test.jpg",
      "createdOn": 788400000000,
      "ownerId": 2,
      "ownerName": "blogManager"
    },
    {
      "id": 99,
      "title": "this is article nr 3 from BLOG article",
      "intro": "this is an article about BLOG",
      "imageFileName": "test.jpg",
      "createdOn": 630720000000,
      "ownerId": 1,
      "ownerName": "articleManager"
    },
    {
      "id": 98,
      "title": "this is article nr 2 from BLOG article",
      "intro": "this is an article about BLOG",
      "imageFileName": "test.jpg",
      "createdOn": 473040000000,
      "ownerId": 3,
      "ownerName": "newsManager"
    },
    {
      "id": 97,
      "title": "this is article nr 1 from BLOG article",
      "intro": "this is an article about BLOG",
      "imageFileName": "test.jpg",
      "createdOn": 315360000000,
      "ownerId": 3,
      "ownerName": "newsManager"
    },
    {
      "id": 96,
      "title": "this is article nr 0 from BLOG article",
      "intro": "this is an article about BLOG",
      "imageFileName": "test.jpg",
      "createdOn": 157680000000,
      "ownerId": 1,
      "ownerName": "articleManager"
    }
  ],
  "totalPages": 1,
  "totalElements": 5,
  "last": true,
  "size": 5,
  "number": 0,
  "sort": null,
  "first": true,
  "numberOfElements": 5
}

back to overview

#Paragraphs from article /reports/article/1

{
  "0": {
    "paragraphTitle": "this is the paragraph nr 1",
    "paragraphText": "this is a paragraph about a lot of blabla(1)",
    "imageFileName": null
  },
  "1": {
    "paragraphTitle": "this is the paragraph nr 2",
    "paragraphText": "this is a paragraph about a lot of blabla(2)",
    "imageFileName": "test.jpg"
  },
  "2": {
    "paragraphTitle": "this is the paragraph nr 3",
    "paragraphText": "this is a paragraph about a lot of blabla(3)",
    "imageFileName": null
  }
}

back to overview

Clone this wiki locally