Ssibrahimbas location-app

Overview


Ssibrahimbas location-app

With this API you can currently add, list, filter, delete and update countries and cities.



Endpoints

Create Country

You can add country with this endpoint.


Parameters

Parameter Is Required Type
name true string
langCode true string

Returns

is success

{
  "success": true,
  "message": "Country successfully created"
}

Validation Error

{
   "success": false,
   "message": "Validation Error",
   "data": [
      {
         "field": "name",
         "message": "name field is required"
      }
   ]
}

Authorization Error

{
    "success": false,
    "message": "You must be logged in to access this page"
}

Example Requests

look at requests folder for example requests.


Update Country

You can update country with this endpoint.


Parameters

Parameter Is Required Type
name false string
langCode false string

Note: you just have to submit the field you want to update. If the name and langCode are not sent at the same time, an error will be returned.


Returns

is success

{
  "success": true,
  "message": "Country successfully updated"
}

Not Changed

{
   "success": false,
   "message": "Change not detected."
}

Authorization Error

{
    "success": false,
    "message": "You must be logged in to access this page"
}

Example Requests

look at requests folder for example requests.


Get Country

You can get country with this endpoint.


Parameters

Parameter Is Required Type
id true integer

Returns

is success

{
  "success": true,
  "message": "Country successfully fetched",
  "data": {
    "id": 1,
    "name": "Ukraine",
    "langCode": "uk-UA"
  }
}

Validation Error

{
   "success": false,
   "message": "Validation Error",
   "data": [
      {
         "field": "id",
         "message": "id field is required"
      }
   ]
}

Example Requests

look at requests folder for example requests.


GetAll Country

You can get all countries with this endpoint.


Parameters

Parameter Is Required Type Default
page false integer 1
limit false integer 20
order false string name
sort false string desc
filter false string -

Returns

is success

{
  "success": true,
  "message": "Countries successfully fetched",
  "data": {
    "page": 2,
    "limit": 20,
    "countries": [
      {
        "id": 2,
        "name": "Ukraine",
        "langCode": "uk-UA"
      },
      {
        "id": 3,
        "name": "Turkey",
        "langCode": "tr-TR"
      }
    ]
  }
}

Example Requests

look at requests folder for example requests.


Delete Country

You can delete country with this endpoint.


Parameters

Parameter Is Required Type
id true integer

Returns

is success

{
  "success": true,
  "message": "Country successfully deleted"
}

Validation Error

{
   "success": false,
   "message": "Validation Error",
   "data": [
      {
         "field": "id",
         "message": "id field is required"
      }
   ]
}

Authorization Error

{
    "success": false,
    "message": "You must be logged in to access this page"
}

Example Requests

look at requests folder for example requests.




Create City

You can add city with this endpoint.


Parameters

Parameter Is Required Type
name true string
plateCode true number
countryId true number

Returns

is success

{
  "success": true,
  "message": "City successfully created"
}

Validation Error

{
   "success": false,
   "message": "Validation Error",
   "data": [
      {
         "field": "name",
         "message": "name field is required"
      }
   ]
}

Authorization Error

{
    "success": false,
    "message": "You must be logged in to access this page"
}

Example Requests

look at requests folder for example requests.


Update City

You can update city with this endpoint.


Parameters

Parameter Is Required Type
name false string
plateCode false number

Note: you just have to submit the field you want to update. If the name and plateCode are not sent at the same time, an error will be returned.


Returns

is success

{
  "success": true,
  "message": "City successfully updated"
}

Not Changed

{
   "success": false,
   "message": "Change not detected."
}

Authorization Error

{
    "success": false,
    "message": "You must be logged in to access this page"
}

Example Requests

look at requests folder for example requests.


Get City

You can get city with this endpoint.


Parameters

Parameter Is Required Type
id true integer

Returns

is success

{
  "success": true,
  "message": "City successfully fetched",
  "data": {
      "cityId": 1,
      "cityName": "Istanbul",
      "countryId": 1,
      "plateCode": 34,
      "countryName": "Turkey",
      "langCode": "tr-TR"
  }
}

Validation Error

{
   "success": false,
   "message": "Validation Error",
   "data": [
      {
         "field": "id",
         "message": "id field is required"
      }
   ]
}

Example Requests

look at requests folder for example requests.


GetAll Cities

You can get all cities with this endpoint.


Parameters

Parameter Is Required Type Default
page false integer 1
limit false integer 20
order false string name
sort false string desc
filter false string -
countryId false number -

Returns

is success

{
  "success": true,
  "message": "Cities successfully fetched",
  "data": {
      "page": 1,
      "limit": 20,
      "cities": [
          {
              "cityId": 1,
              "cityName": "İstanbul",
              "plateCode": 34,
              "countryId": 1,
              "countryName": "Turkey",
              "langCode": "tr-TR"
          },
          {
              "cityId": 2,
              "cityName": "Ankara",
              "plateCode": 6,
              "countryId": 1,
              "countryName": "Turkey",
              "langCode": "tr-TR"
          }
      ]
}

Example Requests

look at requests folder for example requests.


Delete City

You can delete city with this endpoint.


Parameters

Parameter Is Required Type
id true integer

Returns

is success

{
  "success": true,
  "message": "City successfully deleted"
}

Validation Error

{
   "success": false,
   "message": "Validation Error",
   "data": [
      {
         "field": "id",
         "message": "id field is required"
      }
   ]
}

Authorization Error

{
    "success": false,
    "message": "You must be logged in to access this page"
}

Example Requests

look at requests folder for example requests.


Register

You can get register to this app with this endpoint.


Parameters

Parameter Is Required Type Default
email false string [email protected]
password false string 12345

Returns

is success

{
  "success": true,
  "message": "User register successfully"
}

already exists

{
    "success": false,
    "message": "User already exists."
}

Validation Error

{
   "success": false,
   "message": "Validation Error",
   "data": [
      {
         "field": "email",
         "message": "email field is required"
      },
      {
         "field": "password",
         "message": "password field is required"
      }
   ]
}

Log In

You can get login to this app with this endpoint.


Parameters

Parameter Is Required Type Default
email false string [email protected]
password false string 12345

Returns

is success

{
    "success": true,
    "message": "Successfully logged in",
    "data": {
        "email": "[email protected]",
        "createdAt": "2022-03-27"
    }
}

not found

{
    "success": false,
    "message": "User not found."
}

Validation Error

{
   "success": false,
   "message": "Validation Error",
   "data": [
      {
         "field": "email",
         "message": "email field is required"
      },
      {
         "field": "password",
         "message": "password field is required"
      }
   ]
}

Log Out

You can get log out from this app with this endpoint.


Returns

Authorization Error

{
    "success": false,
    "message": "You must be logged in to access this page"
}

is success

{
    "success": true,
    "message": "Successfully Signed out"
}
You might also like...
Here are few exercises to practice how to implement API Security with NGINX App-Protect WAF.

api-security-lab This repo contains files for customers and partners to practice an API Security with NGINX App-Protect WAF. To demonstrate the capabi

PHP project for tracking Azure AD App Reg secrets about to expire, and (manually) tracking SSL certificates

CertExpiry Katy Nicholson https://katystech.blog/ Setup instructions etc available at: https://katystech.blog/2021/11/certexpiry/ PHP project for trac

Simple class that implement a CAPTCHA for your PHP App.

simple-captcha Simple class that implement a CAPTCHA for your PHP App. Installation Use the package manager composer to install. composer require will

Web app for kick session in a server 1C use rac/ras

Server requirement OS: Ubuntu 20.04 Usage Update adm1c nano adm1c You should change server_name adm1c.example.com to your name Update index.php nano

Static Web App to train Filipinos in using MS Word with the use of Filipino language
Static Web App to train Filipinos in using MS Word with the use of Filipino language

MS Word Filipino Isang static web application na layuning magturo ng paggamit ng MS Word sa wikang Filipino. Ito ay isang proyekto na bahagi ng panana

crm_chatbot is an app which allows to create a chat for websites.

CRM Chatbot This app could be installed only in the Midrub CMS version 0.0.8.5+. In older versions it will break anything. DEMO VIDEO: https://youtu.b

Perch Dashboard app for exporting content to (Kirby) text files and Kirby Blueprint files
Perch Dashboard app for exporting content to (Kirby) text files and Kirby Blueprint files

toKirby Perch Dashboard app for exporting content to (Kirby) text files and Kirby Blueprint files. You can easily install and test it in a few steps.

🔖 Bookmark app for Nextcloud
🔖 Bookmark app for Nextcloud

Nextcloud Bookmarks Bookmarks app for Nextcloud This app provides you with a web interface for collecting and organizing bookmarks to the places on th

PHP lightweight in-app Web Application Firewall
PHP lightweight in-app Web Application Firewall

ADEL-WAF PHP lightweight in-app Web Application Firewall. Features / Protections Against: Cross-site scripting (XSS) SQL injection (SQLI) Remote file

Owner
Sami Salih İbrahimbaş
Full Stack Developer
Sami Salih İbrahimbaş
Ip2region is a offline IP location library with accuracy rate of 99.9% and 0.0x millseconds searching performance. DB file is ONLY a few megabytes with all IP address stored. binding for Java,PHP,C,Python,Nodejs,Golang,C#,lua. Binary,B-tree,Memory searching algorithm

Ip2region是什么? ip2region - 准确率99.9%的离线IP地址定位库,0.0x毫秒级查询,ip2region.db数据库只有数MB,提供了java,php,c,python,nodejs,golang,c#等查询绑定和Binary,B树,内存三种查询算法。 Ip2region特性

Lion 12.6k Dec 30, 2022
Get mobile app version and other related data from Google Play Store, Apple App Store and Huawei AppGallery

Mobile App Version Get mobile app version and other related data from Google Play Store, Apple App Store and Huawei AppGallery. Installation Add to co

Omer Salaj 11 Mar 15, 2022
This is an example app demonstrating how to deploy a php app to runway.

Runway Example php App This is an example app demonstrating how to deploy a php app to runway. clone this repo, and navigate into that directory runwa

Planetary Quantum GmbH 0 Aug 9, 2022
HTMX example app that demonstrates how to use HTMX to add javascript interactivity to a serverside rendered PHP app

HTMX examle app This demo app demonstrates how to use HTMX to transform a server side rendered PHP app into a more 'interactive' app with AJAX request

Alexander Morland 3 Dec 11, 2022
Easily create and read Corona Warn App Check-In URLs

bauer-kirch/cwa-event-registration-url This PHP library allows generating Check-In URLs for the Corona Warn App which can then be used to generate a Q

Bauer + Kirch GmbH 9 Dec 30, 2021
Tutorial app which is built in the tutorial

Nextcloud App Tutorial This is the tutorial app which shows how to develop a very simple notes app. Try it To install it change into your Nextcloud's

Nextcloud 43 Dec 2, 2022
ShellHacks 2021 Project: URide is a carpooling app for College students to get to and from campus

ShellHacks 2021 Project: URide is a carpooling app for College students to get to and from campus. Focused on scheduling it matches you to students nearby with similar schedules to alleviate campus parking and emissions.

Kayla Marcantonio 2 Sep 27, 2021
Block malicious scripts using botscout.com protection for your laravel app

Laravel BotScout Protect your website against automated scripts using the botscout.com API. Installation You can install the package via composer: com

Nicolas Beauvais 64 Jul 30, 2022
You have just downloaded "Messenger-app" [A lightweight, minimalistic real-time chat application]

MESSENGER-APP You have just downloaded "Messenger-app" [A lightweight, minimalistic real-time chat application] Setup To get it working, follow these

Chr1st0ph3r SAB 1 Oct 29, 2021
Open App Engine

Open App Engine

Light App Engine 20 Dec 18, 2022