An open API service indexing awesome lists of open source software.

https://github.com/tbreuss/notes-api

:green_book: REST-API for Notes Management Tool
https://github.com/tbreuss/notes-api

jwt-authentication notes-app php7 rest-api yii2

Last synced: 8 months ago
JSON representation

:green_book: REST-API for Notes Management Tool

Awesome Lists containing this project

README

          

# Notes Management Tool – REST-API

[![Yii](https://img.shields.io/badge/Powered_by-Yii_Framework-green.svg?style=flat)](http://www.yiiframework.com/)

The REST-API for the Notes Management Tool.

Note: This is the API only.
You need the appropriate client which is hosted at .

## Install

git clone https://github.com/tbreuss/notes-api.git
cd notes-api
composer install

## Create/import database

Create a database at your hosting provider and import `config\mysql-dump.sql`.

## Config

Copy configuration files:

cd config
cp db.dist.php db.php
cp params.dist.php params.php

Edit both files according to your config settings.

## Run

cd notes-server
php yii serve -p 8888

Open your webbrowser

You should see:


REST-API for Notes Management Tool
You need an appropriate client to access this API
https://github.com/tbreuss/notes-client
https://notes.tebe.ch

## Build

composer build

Build a zip archive for production. Needs globally installed `git` and `composer` and an existing `config/prod.env.php`.


## Endpoints

To be done.

### GET v1/ping

### POST v1/login

### GET v1/articles/

### PUT v1/articles/

### DELETE v1/articles/

### GET v1/articles

### POST v1/articles

### GET v1/articles/latest

### GET v1/articles/liked

### GET v1/articles/modified

### GET v1/articles/popular

### POST v1/articles/upload

### GET v1/users/

### GET v1/users

### GET v1/tags/

### GET v1/tags

### GET v1/tags/selected

## cURL calls

To be done.

Post login

curl -i --header "Content-Type: application/json" --request POST --data '{"username":"xyz","password":"xyz"}' http://localhost:8888/v1/login
curl -i --header "Content-Type: application/json" --request OPTIONS --data '{"username":"xyz","password":"xyz"}' http://localhost:8888/v1/login
curl -i -X OPTIONS http://localhost:8888/ --header "Content-Type: application/json"