Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "swagger": "2.0",
- "info": {
- "version": "1.0.0",
- "title": "SendPulse API",
- "description": "Easy, reliable, fast email and push service",
- "x-logo": {
- "url": "https://sendpulse.com/ru/academy/wp-content/uploads/2015/03/big-logo-for-RY.png"
- }
- },
- "host": "api.sendpulse.com",
- "schemes": [
- "https"
- ],
- "basePath": "/",
- "externalDocs": {
- "url": "https://login.sendpulse.com/manual/rest-api/"
- },
- "produces": [
- "application/json"
- ],
- "security": [
- {
- "oauth_2_0": [
- "read",
- "write"
- ]
- }
- ],
- "tags": [
- {
- "name": "balance"
- },
- {
- "name": "blacklists"
- },
- {
- "name": "books"
- },
- {
- "name": "campaigns"
- },
- {
- "name": "senders"
- },
- {
- "name": "smtp"
- },
- {
- "name": "subscribers"
- },
- {
- "name": "web push"
- }
- ],
- "securityDefinitions": {
- "oauth_2_0": {
- "type": "oauth2",
- "authorizationUrl": "https://api.sendpulse.com/oauth/authorize",
- "tokenUrl": "https://api.sendpulse.com/oauth/access_token",
- "flow": "accessCode",
- "scopes": {
- "read": "Read any data",
- "write": "Write any data"
- }
- }
- },
- "paths": {
- "/addressbooks": {
- "get": {
- "operationId": "getAddressBooks",
- "summary": "List all address books.",
- "description": "Retrieve a list of all of the address books that have been created, \nalong with detailed information on each of them.\n",
- "parameters": [
- {
- "name": "limit",
- "in": "query",
- "description": "The number of records",
- "required": false,
- "type": "integer"
- },
- {
- "name": "offset",
- "in": "query",
- "description": "Offset (first record to be displayed)",
- "required": false,
- "type": "integer"
- }
- ],
- "responses": {
- "200": {
- "description": "Successful response",
- "schema": {
- "title": "ArrayOfBooks",
- "type": "array",
- "items": {
- "$ref": "#/definitions/AddressBook"
- }
- }
- },
- "default": {
- "description": "Unexpected error",
- "schema": {
- "$ref": "#/definitions/Error"
- }
- }
- },
- "tags": [
- "books"
- ]
- },
- "post": {
- "operationId": "createAddressBook",
- "summary": "Create address book.",
- "description": "Create a new address book with given name.",
- "parameters": [
- {
- "name": "bookName",
- "in": "formData",
- "description": "The new book name.",
- "required": true,
- "type": "string"
- }
- ],
- "responses": {
- "200": {
- "description": "Successful response"
- },
- "default": {
- "description": "Unexpected error",
- "schema": {
- "$ref": "#/definitions/Error"
- }
- }
- },
- "tags": [
- "books"
- ]
- }
- },
- "/addressbooks/{bookId}": {
- "get": {
- "operationId": "getAddressBookInfo",
- "description": "Retrieve detailed information regarding a specific address book.",
- "parameters": [
- {
- "name": "bookId",
- "in": "path",
- "description": "Book ID.",
- "required": true,
- "type": "integer"
- }
- ],
- "responses": {
- "200": {
- "description": "Successful response",
- "schema": {
- "title": "ArrayOfSubscribers",
- "type": "array",
- "items": {
- "$ref": "#/definitions/Subscriber"
- }
- }
- },
- "default": {
- "description": "Unexpected error",
- "schema": {
- "$ref": "#/definitions/Error"
- }
- }
- },
- "tags": [
- "books"
- ]
- },
- "put": {
- "operationId": "editAddressBook",
- "description": "Edit the address book name.",
- "parameters": [
- {
- "name": "bookId",
- "in": "path",
- "description": "Book ID.",
- "required": true,
- "type": "integer"
- },
- {
- "name": "name",
- "in": "formData",
- "description": "The new name of the book.",
- "required": true,
- "type": "string"
- }
- ],
- "responses": {
- "200": {
- "description": "Successful response",
- "schema": {
- "$ref": "#/definitions/SuccessResult"
- }
- },
- "default": {
- "description": "Unexpected error",
- "schema": {
- "$ref": "#/definitions/Error"
- }
- }
- },
- "tags": [
- "books"
- ]
- }
- },
- "/addressbooks/{bookId}/emails": {
- "get": {
- "description": "Retrieve a list of email addresses from a particular address book.",
- "parameters": [
- {
- "name": "bookId",
- "in": "path",
- "description": "Book ID.",
- "required": true,
- "type": "integer"
- },
- {
- "name": "limit",
- "in": "query",
- "description": "The number of records",
- "required": false,
- "type": "integer"
- },
- {
- "name": "offset",
- "in": "query",
- "description": "Offset (first record to be displayed)",
- "required": false,
- "type": "integer"
- }
- ],
- "responses": {
- "200": {
- "description": "Successful response",
- "schema": {
- "title": "ArrayOfSubscribers",
- "type": "array",
- "items": {
- "$ref": "#/definitions/Subscriber"
- }
- }
- },
- "default": {
- "description": "Unexpected error",
- "schema": {
- "$ref": "#/definitions/Error"
- }
- }
- },
- "tags": [
- "books",
- "subscribers"
- ]
- }
- }
- },
- "definitions": {
- "AddressBook": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string",
- "description": "Book ID."
- },
- "name": {
- "type": "string",
- "description": "Book name."
- },
- "all_email_qty": {
- "type": "number",
- "description": "Total number of emails."
- },
- "active_email_qty": {
- "type": "number",
- "description": "Number of active emails."
- },
- "inactive_email_qty": {
- "type": "number",
- "description": "Number of inactive emails."
- },
- "creationdate": {
- "type": "string",
- "format": "date",
- "description": "Date of creation."
- },
- "status": {
- "type": "number",
- "description": "Status code"
- },
- "status_explain": {
- "type": "string",
- "description": "Status explanation."
- }
- }
- },
- "Subscriber": {
- "type": "object",
- "properties": {
- "email": {
- "type": "string",
- "format": "email",
- "description": "Valid email address of subscriber."
- },
- "status": {
- "type": "integer",
- "description": "Status code."
- },
- "status_explain": {
- "type": "string",
- "description": "Full status explanation."
- },
- "variables": {
- "type": "object"
- }
- }
- },
- "Error": {
- "type": "object",
- "properties": {
- "error": {
- "type": "string",
- "description": "Short error description."
- },
- "error_code": {
- "type": "integer",
- "description": "Error code."
- },
- "error_description": {
- "type": "string",
- "description": "Detailed error explanation."
- },
- "message": {
- "type": "string",
- "description": "Fullr error message."
- }
- }
- },
- "SuccessResult": {
- "type": "object",
- "properties": {
- "result": {
- "type": "boolean",
- "description": "Result status of operation."
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement