🌐
GitHub
github.com › typicode › json-server
GitHub - typicode/json-server: Get a full fake REST API with zero coding in less than 30 seconds (seriously) · GitHub
JSON Server started on PORT :3000 http://localhost:3000 · Access your REST API: curl http://localhost:3000/posts/1 · Response: { "id": "1", "title": "a title", "views": 100 } Run json-server --help for a list of options · Become a sponsor ...
Starred by 75.7K users
Forked by 7.3K users
Languages   JavaScript 91.7% | HTML 8.3%
🌐
GitHub
docs.github.com › en › rest › using-the-rest-api › getting-started-with-the-rest-api
Getting started with the REST API - GitHub Docs
The following example uses the "Create an issue" endpoint to create a new issue in the octocat/Spoon-Knife repository. In the response, find the html_url of your issue, and navigate to your issue in the browser.
🌐
GitHub
github.com › public-apis › public-apis
GitHub - public-apis/public-apis: A collective list of free APIs · GitHub
Industry-leading Holiday API. Over 5,000 holidays and thousands of descriptions. Trusted by the World’s leading companies ... Free and simple counting service. You can use it to track page hits and specific events ... Free JSON storage service. Ideal for small scale Web apps, Websites and Mobile apps ... Clockify's REST-based API can be used to push/pull data to/from it & integrate it with other systems
Starred by 410K users
Forked by 44.3K users
Languages   Python 96.8% | Shell 3.2%
🌐
GitHub
github.com › api-samples
JSON REST API Sample Applications · GitHub
Python Countries REST JSON API example · Python · Showing 8 of 8 repositories · countries-sinatra Public · A simple REST JSON API built with Ruby / Sinatra · There was an error while loading. Please reload this page. api-samples/countries-sinatra’s past year of commit activity ·
🌐
GitHub
github.com › topics › json-api
json-api · GitHub Topics · GitHub
JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This first draft was extracted from the JSON transport implicitly defined by Ember Data’s REST adapter.
🌐
GitHub
docs.github.com › en › rest › quickstart
Quickstart for GitHub REST API - GitHub Docs
on: workflow_dispatch: jobs: use_api: runs-on: ubuntu-latest permissions: issues: read steps: - env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | curl --request GET \ --url "https://api.github.com/repos/octocat/Spoon-Knife/issues" \ --header "Accept: application/vnd.github+json" \ --header "Authorization: Bearer $GH_TOKEN" If you are authenticating with a GitHub App, you can create an installation access token within your workflow: Store your GitHub App's ID as a configuration variable. In the following example, replace APP_ID with the name of the configuration variable. You can find your app ID on the settings page for your app or through the App API. For more information, see REST API endpoints for GitHub Apps.
🌐
GitHub
github.com › hoppinger › json-rest-api
GitHub - hoppinger/json-rest-api: A JSON-based REST API for WordPress
Update user with ID 4? Send a POST request to /wp-json/users/4. Get all posts with the search term "awesome"? GET /wp-json/posts?filter[s]=awesome. It's that easy. WP API exposes a simple yet easy interface to WP Query, the posts API, post meta ...
Author   hoppinger
🌐
JSONPlaceholder
jsonplaceholder.typicode.com
JSONPlaceholder - Free Fake REST API
JSONPlaceholder is a free online REST API that you can use whenever you need some fake data. It can be in a README on GitHub, for a demo on CodeSandbox, in code examples on Stack Overflow, ...or simply to test things locally.
🌐
GitHub
github.com › json-api › json-api
GitHub - json-api/json-api: A specification for building JSON APIs · GitHub
A specification for building JSON APIs. Contribute to json-api/json-api development by creating an account on GitHub.
Starred by 7.7K users
Forked by 920 users
Languages   CSS 43.6% | JavaScript 37.8% | HTML 7.7% | Sass 3.4% | Python 2.9% | Makefile 2.0%
Find elsewhere
🌐
GitHub
github.com › topics › rest-api-example
rest-api-example · GitHub Topics · GitHub
wordpress wordpress-plugin ... rest-api-example create-post custom-endpoints ... Create REST API with most trending technology - PYTHON, PHP, GO, NodeJS and trending Frameworks like Laravel, GIN, Flask, DJANGO. You are JUST 5 Min Way to Create REST API. REST API Tutorials · nodejs python api golang flask laravel django php7 json-api rest-api ...
Top answer
1 of 2
9

You were close:) Lets assume, that

1) your login: YourUsername

2) your access token: 123a321

3) repository to be updated: YourRepo

4) file to be created: file.txt

5) folder that will contains new file: f1/f2

According to those assumptions your request should be following:

type : PUT

url : https://api.github.com/repos/YourUsername/YourRepo/contents/f1/f2/file.txt

headers :

{
 "Content-Type" : "application/vnd.github.v3+json",
 "Authorization" : "token 123a321"
}

body :

{
  "message": "my commit message",
  "committer": {
    "name": "My name",
    "email": "my email"
  },
  "content": "base64encoded"
}


UPD If you write in java, you can use GitHubFileAPI library, that I recently pushed to the maven central repository.

2 of 2
0

Solution: In order to perform action on github api you can use curl according to Github doc:

  1. first make sure you have specific privileges and authentication token generated to your account in order to interact with Github api:

profile Settings -> Developer Settings -> Personal access tokens -> Generate new token

  1. the command should be in http PUT method on path /repos/:owner/:repo/contents/:path
  2. The required params for editing or adding new files (according to api) message (String), Content (String) and sha(String), additional params are branch(String) commiter(String) and author(String)

Lets perform some curl message in order to perform your action, the simple formula for this case would be:

curl --user <userName>:<token>
--data '{"key":"value"}'
--header <HeaderType>
--request <HTTPMethod>
<fullURL>

for demonstration lets fill some details:

 curl --user johnDoe:abc123!@#
 --data '{"message":"my message","content":"my content","sha":"abcjfhtenf736gd843ji43903"}'
 --header Content-Type:application/json
 --request PUT
https://api.github.com/repos/MyOrganization/MyCoolApp/contents/app/models
  1. Verify on Github the content has been inserted correctly to your branch
🌐
GitHub
github.com › json-api
json-api · GitHub
json-api has 8 repositories available. Follow their code on GitHub.
🌐
GitHub
github.com › ethanresnick › json-api-example
GitHub - ethanresnick/json-api-example: An example API created with my JSON-API library (http://github.com/ethanresnick/json-api) · GitHub
An example API created with v3 of my JSON-API library (http://github.com/ethanresnick/json-api).
Starred by 31 users
Forked by 15 users
Languages   JavaScript
🌐
GitHub
docs.github.com › en › rest
GitHub REST API documentation - GitHub Docs
Timezones and the REST API · Using CORS and JSONP to make cross-origin requests · Issue event types · GitHub event types · Authenticating to the REST API · Keeping your API credentials secure · Endpoints available for GitHub App installation access tokens ·
🌐
GeeksforGeeks
geeksforgeeks.org › git › getting-started-with-github-rest-api
Getting Started With GitHub REST API - GeeksforGeeks
July 23, 2025 - Here’s an example using curl to fetch your GitHub user details: curl -H "Authorization: token YOUR_PERSONAL_ACCESS_TOKEN" https://api.github.com/user · Replace YOUR_PERSONAL_ACCESS_TOKEN with your actual token. The response should include your GitHub user details in JSON format. A GitHub REST ...
🌐
GitHub
docs.github.com › en › rest › repos › contents
REST API endpoints for repository contents - GitHub Docs
Use the REST API to create, modify, and delete Base64 encoded content in a repository. Gets the contents of a file or directory in a repository. Specify the file path or directory with the path parameter.
🌐
GitHub
github.com › django-json-api › django-rest-framework-json-api
GitHub - django-json-api/django-rest-framework-json-api: JSON:API support for Django REST framework · GitHub
$ git clone https://github.com/django-json-api/django-rest-framework-json-api.git $ cd django-rest-framework-json-api $ pip install -e .
Starred by 1.2K users
Forked by 300 users
Languages   Python 99.5% | HTML 0.5%