Skip to content

Emojinaija is a rest API service that provide access to unlimited emoji images

License

Notifications You must be signed in to change notification settings

ibonly/emojinaija

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

65 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

emojinaija

Build Status License Quality Score Scrutinizer Code Quality Code Climate Test Coverage

Emojinaija is a restful API service that provide access for emoji management. Just link to the emojinaija.

Installation

PHP 5.5+ and Composer are required.

Via Composer

$ composer require ibonly/naija-emoji
$ composer install

Usage

API ENDPOINT

        EndPoint                        Public Access
    POST /auth/Login                        TRUE
    GET /auth/Logout                        FALSE
    POST /emojis                            FALSE
    GET /emojis/                            TRUE
    GET /emojis/{id}                        TRUE
    POST /emojis/{id}                       FALSE
    PATCH /emojis/{id}                      FALSE
    PUT /emojis/{id}                        FALSE
    DELETE /emojis/{id}                      FALSE

API FUNCTIONALITY

        EndPoint                            Functionality
    POST /auth/login                   Logs a user in
    GET /auth/logout                   Logs a user out
    GET /emojis                        List all the created emojis.
    GET /emojis/{id}                   Gets a single emoji
    POST /emojis                       Create a new emoji
    PUT /emojis/{id}                   Updates an emoji
    PATCH /emojis/{id}                 Partially updates an emoji
    DELETE /emojis/{id}                Deletes a single emoji

Methods accessible to the public

####Single emoji retrieval

REQUEST:

    GET https://emojinaija.herokuapp.com/emoji/1
    HEADER: {"Content-Type": "application/json"}

RESPONSE MESSAGE: If emoji with id of 1 exist:

    HEADER: {"status": 200}
    BODY:
    [
        {
          "id": 1,
          "name": "lips",
          "char": "๏ฟฝ"
          "keyword": [
            "lips",
            "parts",
            "body",
            "kiss"
          ],
          "category": "human",
          "date_created": "2015-11-19 22:37:08",
          "date_modified": "2015-10-19 22:37:08",
          "created_by": "foo"
        }
    ]

RESPONSE MESSAGE: If emoji of id 1 is not found

    HEADER: {"status": 404}
    BODY:
    {
      "message": "Not Found"
    }
  • Retrieve all emoji

REQUEST:

    HEADER: GET https://emojinaija.herokuapp.com/emojis
    HEADER: {"Content-Type": "application/json"}

RESPONSE MESSAGE: Get all emoji:

    HEADER: {"status": 200}
    BODY: If there are saved resources
    [
        {
            "id": 3,
            "name": "Olopa",
            "char": "๐Ÿ‘ฎ",
            "keywords": [
              "man",
              "police",
              "human"
            ],
            "category": "Peoples",
            "date_created": "2015-11-25 09:30:19",
            "date_modified": "2015-11-25 09:35:00",
            "created_by": "foo"
          },
          {
            "id": 4,
            "name": "nose",
            "char": "๐Ÿ‘ƒ",
            "keywords": [
              "human parts",
              "nose",
              "body"
            ],
            "category": "human",
            "date_created": "2015-11-26 09:09:46",
            "date_modified": "2015-11-26 09:09:46",
            "created_by": "foo"
          },
          {
            "id": 5,
            "name": "Prof",
            "char": "๐Ÿ‘ด",
            "keywords": [
              "Human",
              "People"
            ],
            "category": "Human",
            "date_created": "2015-11-26 15:32:19",
            "date_modified": "2015-11-26 15:32:19",
            "created_by": "foo"
        }
    ]

RESPONSE MESSAGE: If no emoji found:

    HEADER: {"status": 404}
    BODY:
    {
      "message": "Not Found"
    }
  • In order to access private methods, Registration is required and a token will be generated for the registered user when logged in. The token generated will be used to access private API.

  • Registration

REQUEST:

    POST https://emojinaija.herokuapp.com/register
    HEADER: {"Content-Type": "application/json"}
    BODY:
    {
      "username": your_preferred_username,
      "password": your_preferred_password
    }

RESPONSE MESSAGE:

    HEADER: {"status": 200}
    BODY:
    {
      "username": "ogeni",
      "message": "Registration Successful. Please Login to generate your token"
    }
  • Login authentication

REQUEST:

    POST https://emojinaija.herokuapp.com/auth/login
    HEADER: {"Content-Type": "application/json"}
    BODY:
    {
      "username": your_username,
      "password": your_password
    }

RESPONSE MESSAGE:

    HEADER: {"status": 200}
    BODY:
    {
      "username": "user",
      "Authorization": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9eyJpc3"
    }
  • Logout

REQUEST:

    GET https://emojinaija.herokuapp.com/auth/logout
    HEADER:
    {
      "Content-Type": "application/json",
      "Authorization": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9eyJpc3"
    }

RESPONSE MESSAGE:

    HEADER: {"status": 200}
    BODY:
    {
      "message": "Logged out Successfully"
    }
  • Creating new emoji

REQUEST:

    POST https://emojinaija.herokuapp.com/emojis
    HEADER:
    {
      "Content-Type": "application/json",
      "Authorization": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9eyJpc3"
    }

    BODY:
    {
      "name": "Horse",
      "char" : "๐ŸŽ"
      "keyword": "Animal, Horse, Farm, Esin",
      "category": "Animal"
    }

RESPONSE MESSAGE:

    HEADER: {"status": 200}
    BODY:
    {
      "id": 9,
      "name": "Horse",
      "char" : "๐ŸŽ"
      "keyword": [
        "Animal",
        "Horse",
        "Farm",
        "Esin"
      ],
      "category": "Animal",
      "date_created": "2015-11-26 15:32:19",
      "date_modified": "2015-11-26 15:32:19",
      "created_by": "foo"
    }
  • Updating emojis

REQUEST:

    PUT https://emojinaija.herokuapp.com/emojis/9
    PATCH https://emojinaija.herokuapp.com/emojis/9
    HEADER:
    {
      "Content-Type": "application/json",
      "Authorization": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9eyJpc3"
    }
    BODY:
    {
          "keyword": "Animal, Horse, Farm, Esin, Zoo",
    }

RESPONSE MESSAGE:

    HEADER: {"status": 200}
    BODY:
    {
      "Message" => "Emoji Updated Successfully"
    }
  • Delete an emojis

REQUEST:

    DELETE https://emojinaija.herokuapp.com/emojis/9
    HEADER:
    {
      "Content-Type": "application/json",
      "Authorization": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9eyJpc3"
    }

RESPONSE MESSAGE:

    HEADER: {"status": 200}
    BODY:
    {
      "Message" => "Emoji Deleted"
    }

Testing

$ vendor/bin/phpunit test

Contributing

To contribute and extend the scope of this package, Please check out CONTRIBUTING file for detailed contribution guidelines.

Credits

Emojinaija is created and maintained by Ibraheem ADENIYI.

About

Emojinaija is a rest API service that provide access to unlimited emoji images

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published