-
-
Notifications
You must be signed in to change notification settings - Fork 36
API v2
Julian Gojani edited this page Jul 4, 2021
·
7 revisions
You can get your API-Key from https://pastefy.ga/apikeys Header:
Authorization: Bearer <YOUR-API-KEY>
Response: #Paste Example:
{
"id":"A9aK4sU0",
"title": "",
"content": "",
"encrypted": false,
"user_id": 53,
"created": "2021-01-31 19:55:33.0",
"exists":true
}
Request Example
{
"title": "test.txt",
"content": "Hello world :)",
"encrypted": false // Client Encryption enabled
}
Returns Response: #Paste
{
"success": true,
"paste": #Paste Response
}
Edit a paste Request Example
{
"title": "test.txt",
"content": "I am edited!"
}
Returns Response: #Paste
{
"success": true,
"paste": #Paste Response
}
Example:
{
"success":true
}
Request Example
{
"name": "example"
}
Returns Response: #Folder
{
"success": true,
"paste": #Folder Response
}
Response: #Folder Example:
{
"id":"vZoF4hIZ",
"name":"Hello world!",
"user_id":53,
"children":[],
"exists":true,
"pastes":[
{
"id":"ABABABAB",
"title":"Ye",
"content":"Hello world",
"folder":"vZoF4hIZ",
"encrypted":false,
"user_id":53,
"exists":true,
"created":"2021-01-31 19:13:49.0"
}
]
}
Example:
{
"success":true
}
Example:
{
"id":1,
"name":"ImANiceUser",
"profile_picture":"",
"color":"#fb1740",
"logged_in":true
}
URL-Params
Key | Description |
---|---|
not_read | if set it shows only not already received notifications |
not_received | if set it shows only non received notifications |
The Request sets every notification to received
Example:
[
{
"id":1,
"message":"Message contents",
"url":"/",
"user_id":53,
"already_read":false,
"received":false,
"created_at":"2021-01-31 22:14:50",
"updated_at":"2021-01-31 22:14:50"
}
]
Name | Type | Description |
---|---|---|
id | String(8) | Identifier |
title | String | |
content | String | |
encrypted | boolean | We are using CryptoJS for client-encryption. This indicates if it's client-encrypted |
user_id | int | |
folder | String | |
created | String/Timestamp |
Name | Type | Description |
---|---|---|
id | String(8) | Identifier |
name | String | |
user_id | int | |
children | List<Folder> | |
pastes | List<Paste> | |
created | String/Timestamp |