Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

ahmetilhn/iksirsicom-api

Repository files navigation

İksirsi API

This api is the open source API of the iksirsi.com website

Endpoints

Base URL: https://iksirsi-api.onrender.com/

All ends go through the same control and the same service. (Base controller and base service)

Posts
  • Get All Posts
    fetch("https://iksirsi-api.onrender.com/posts?limit=10", {
      method: "GET",
    });
  • Get One Post
    fetch("https://iksirsi-api.onrender.com/posts/post_id", {
      method: "GET",
    });
  • Post Create Post
    fetch("https://iksirsi-api.onrender.com/posts", {
      method: "POST",
      body: JSON.stringify({
        title: String,
        poster: URL,
        content: [
          {
            type: "code",
            text: String,
          },
          {
            type: "p",
            text: String,
          },
          {
            type: "img",
            img_source: String,
          },
        ],
        medium_link: "",
        tags: [String],
        info: {
          author: {
            user_name: String,
          },
        },
      }),
    });
  • Delete Delete post
    fetch("https://iksirsi-api.onrender.com/posts/post_id", {
      method: "DELETE",
    });
  • Put Update Post
    fetch("https://iksirsi-api.onrender.com/posts", {
      method: "PUT",
      body: JSON.stringify({
        title: String,
        poster: URL,
        content: [
          {
            type: "code",
            text: String,
          },
          {
            type: "p",
            text: String,
          },
          {
            type: "img",
            img_source: String,
          },
        ],
        medium_link: "",
        tags: [String],
        info: {
          author: {
            user_name: String,
          },
        },
      }),
    });
Users
  • Get All Users
    fetch("https://iksirsi-api.onrender.com/users", {
      method: "GET",
    });
  • Get One User
    fetch("https://iksirsi-api.onrender.com/users/email || id", {
      method: "GET",
    });
  • Post Create User
    fetch("https://iksirsi-api.onrender.com/users", {
      method: "POST",
      body: JSON.stringify({
        email: String,
        full_name: String,
        user_name: String,
        avatar: String,
        medium_url: String,
        github_url: String,
        linkedin_url: String,
      }),
    });
  • Delete Delete User
    fetch("https://iksirsi-api.onrender.com/users", {
      method: "DELETE",
    });
  • Put Update User
    fetch("https://iksirsi-api.onrender.com/users", {
      method: "PUT",
      body: JSON.stringify({
        email: String,
        full_name: String,
        user_name: String,
        avatar: String,
        medium_url: String,
        github_url: String,
        linkedin_url: String,
      }),
    });
Likes
  • Get All Likes

    fetch("https://iksirsi-api.onrender.com/likes", {
      method: "GET",
    });
  • Get Likes of Post

    fetch("https://iksirsi-api.onrender.com/likes/post_id", {
      method: "GET",
    });
    Likes
  • Get All Likes

    fetch("https://iksirsi-api.onrender.com/likes", {
      method: "GET",
    });
  • Get Likes of Post

    fetch("https://iksirsi-api.onrender.com/likes/post_id", {
      method: "GET",
    });
  • Post Create Like

    fetch("https://iksirsi-api.onrender.com/likes", {
      method: "DELETE",
      body: JSON.stringify({
        post_id: String,
      }),
    });
  • Delete Delete Like

    fetch("https://iksirsi-api.onrender.com/likes/post_id", {
      method: "DELETE",
    });
Views
  • Get All Views

    fetch("https://iksirsi-api.onrender.com/views", {
      method: "GET",
    });
  • Get Views of Post

    fetch("https://iksirsi-api.onrender.com/views/post_id", {
      method: "GET",
    });
  • Post Create View

    fetch("https://iksirsi-api.onrender.com/views", {
      method: "DELETE",
      body: JSON.stringify({
        post_id: String,
      }),
    });
  • Delete Delete View

    fetch("https://iksirsi-api.onrender.com/views/post_id", {
      method: "DELETE",
    });