API
Introduction
The document contains a description of the program interface to the private notes service - Privatty (further — API). The API provides automated data exchange with the service. Using the API, external applications can create private scraps and download self-destructing files.
To get API Key please contact us. Don't forgot describe your business and where you use our API. After all you get the API key, which is necessary for interaction with the service.
Integration
API requests are processed at https://privatty.com/api/_VERSION_/. Instead of a variable _VERSION_ please set API version. Actual API version is 1.0. Thus, the interaction occurs with the address https://privatty.com/api/1.0/. Below is a list of parameters and their descriptions.
All requests to the API can be carried out through POST and GET. We send results in JSON.
Parameters
Variable | Description | Value |
ver Required | API version | double |
note Required | Plain text for note. You can include line breaks. | string, [3,2048] |
lang Default: en | API language | string, [ru, en] |
confirm Default: 0 | Request confirmation before showing and destroying the note. 0 - no, 1 - yes | integer, [0, 1] |
name Default: NULL | Reference name for the note | string, [3-32] |
destructs Default: 0 | Self-destruction method. 0 - after reading note. All other values equals hours. | int, [0, 1, 3, 24, 168, 720] |
password Default: NULL | Custom password to encrypt the note | string, [6-32] |
email Default: NULL | E-mail to notify when note is destroyed | string, [6-32] |
Request example:
https://privatty.com/api/1.0/?note=test&key=Mz8KEY&lang=en&confirm=1
Answer:
{"status":1,"message":"Note link ready!","url":"https://privatty.com/en/n/kqCuFoi33#NkAlqf029d6"}
Error codes
Code | Name | Description |
101 | Note is empty | Note is empty |
102 | Invalid E-mail | Invalid E-mail |
103 | Password is too simple | Password is too simple |
104 | Name is too long | Name is too long |
105 | Name is too short | Name is too short |
106 | Note is too short | Note is too short |
107 | Note is too long | Note is too long |
108 | Reached max requests per sec | Reached max requests per sec |
109 | API Key not specified | API Key not specified |
110 | Invalid API Key | Invalid API Key |