Advertisement
Guest User

Untitled

a guest
Jun 7th, 2016
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 11.82 KB | None | 0 0
  1. {
  2.     "swagger": "2.0",
  3.     "info": {
  4.         "version": "1.0.0",
  5.         "title": "SendPulse API",
  6.         "description": "Easy, reliable, fast email and push service",
  7.         "x-logo": {
  8.             "url": "https://sendpulse.com/ru/academy/wp-content/uploads/2015/03/big-logo-for-RY.png"
  9.         }
  10.     },
  11.     "host": "api.sendpulse.com",
  12.     "schemes": [
  13.         "https"
  14.     ],
  15.     "basePath": "/",
  16.     "externalDocs": {
  17.         "url": "https://login.sendpulse.com/manual/rest-api/"
  18.     },
  19.     "produces": [
  20.         "application/json"
  21.     ],
  22.     "security": [
  23.         {
  24.             "oauth_2_0": [
  25.                 "read",
  26.                 "write"
  27.             ]
  28.         }
  29.     ],
  30.     "tags": [
  31.         {
  32.             "name": "balance"
  33.         },
  34.         {
  35.             "name": "blacklists"
  36.         },
  37.         {
  38.             "name": "books"
  39.         },
  40.         {
  41.             "name": "campaigns"
  42.         },
  43.         {
  44.             "name": "senders"
  45.         },
  46.         {
  47.             "name": "smtp"
  48.         },
  49.         {
  50.             "name": "subscribers"
  51.         },
  52.         {
  53.             "name": "web push"
  54.         }
  55.     ],
  56.     "securityDefinitions": {
  57.         "oauth_2_0": {
  58.             "type": "oauth2",
  59.             "authorizationUrl": "https://api.sendpulse.com/oauth/authorize",
  60.             "tokenUrl": "https://api.sendpulse.com/oauth/access_token",
  61.             "flow": "accessCode",
  62.             "scopes": {
  63.                 "read": "Read any data",
  64.                 "write": "Write any data"
  65.             }
  66.         }
  67.     },
  68.     "paths": {
  69.         "/addressbooks": {
  70.             "get": {
  71.                 "operationId": "getAddressBooks",
  72.                 "summary": "List all address books.",
  73.                 "description": "Retrieve a list of all of the address books that have been created, \nalong with detailed information on each of them.\n",
  74.                 "parameters": [
  75.                     {
  76.                         "name": "limit",
  77.                         "in": "query",
  78.                         "description": "The number of records",
  79.                         "required": false,
  80.                         "type": "integer"
  81.                     },
  82.                     {
  83.                         "name": "offset",
  84.                         "in": "query",
  85.                         "description": "Offset (first record to be displayed)",
  86.                         "required": false,
  87.                         "type": "integer"
  88.                     }
  89.                 ],
  90.                 "responses": {
  91.                     "200": {
  92.                         "description": "Successful response",
  93.                         "schema": {
  94.                             "title": "ArrayOfBooks",
  95.                             "type": "array",
  96.                             "items": {
  97.                                 "$ref": "#/definitions/AddressBook"
  98.                             }
  99.                         }
  100.                     },
  101.                     "default": {
  102.                         "description": "Unexpected error",
  103.                         "schema": {
  104.                             "$ref": "#/definitions/Error"
  105.                         }
  106.                     }
  107.                 },
  108.                 "tags": [
  109.                     "books"
  110.                 ]
  111.             },
  112.             "post": {
  113.                 "operationId": "createAddressBook",
  114.                 "summary": "Create address book.",
  115.                 "description": "Create a new address book with given name.",
  116.                 "parameters": [
  117.                     {
  118.                         "name": "bookName",
  119.                         "in": "formData",
  120.                         "description": "The new book name.",
  121.                         "required": true,
  122.                         "type": "string"
  123.                     }
  124.                 ],
  125.                 "responses": {
  126.                     "200": {
  127.                         "description": "Successful response"
  128.                     },
  129.                     "default": {
  130.                         "description": "Unexpected error",
  131.                         "schema": {
  132.                             "$ref": "#/definitions/Error"
  133.                         }
  134.                     }
  135.                 },
  136.                 "tags": [
  137.                     "books"
  138.                 ]
  139.             }
  140.         },
  141.         "/addressbooks/{bookId}": {
  142.             "get": {
  143.                 "operationId": "getAddressBookInfo",
  144.                 "description": "Retrieve detailed information regarding a specific address book.",
  145.                 "parameters": [
  146.                     {
  147.                         "name": "bookId",
  148.                         "in": "path",
  149.                         "description": "Book ID.",
  150.                         "required": true,
  151.                         "type": "integer"
  152.                     }
  153.                 ],
  154.                 "responses": {
  155.                     "200": {
  156.                         "description": "Successful response",
  157.                         "schema": {
  158.                             "title": "ArrayOfSubscribers",
  159.                             "type": "array",
  160.                             "items": {
  161.                                 "$ref": "#/definitions/Subscriber"
  162.                             }
  163.                         }
  164.                     },
  165.                     "default": {
  166.                         "description": "Unexpected error",
  167.                         "schema": {
  168.                             "$ref": "#/definitions/Error"
  169.                         }
  170.                     }
  171.                 },
  172.                 "tags": [
  173.                     "books"
  174.                 ]
  175.             },
  176.             "put": {
  177.                 "operationId": "editAddressBook",
  178.                 "description": "Edit the address book name.",
  179.                 "parameters": [
  180.                     {
  181.                         "name": "bookId",
  182.                         "in": "path",
  183.                         "description": "Book ID.",
  184.                         "required": true,
  185.                         "type": "integer"
  186.                     },
  187.                     {
  188.                         "name": "name",
  189.                         "in": "formData",
  190.                         "description": "The new name of the book.",
  191.                         "required": true,
  192.                         "type": "string"
  193.                     }
  194.                 ],
  195.                 "responses": {
  196.                     "200": {
  197.                         "description": "Successful response",
  198.                         "schema": {
  199.                             "$ref": "#/definitions/SuccessResult"
  200.                         }
  201.                     },
  202.                     "default": {
  203.                         "description": "Unexpected error",
  204.                         "schema": {
  205.                             "$ref": "#/definitions/Error"
  206.                         }
  207.                     }
  208.                 },
  209.                 "tags": [
  210.                     "books"
  211.                 ]
  212.             }
  213.         },
  214.         "/addressbooks/{bookId}/emails": {
  215.             "get": {
  216.                 "description": "Retrieve a list of email addresses from a particular address book.",
  217.                 "parameters": [
  218.                     {
  219.                         "name": "bookId",
  220.                         "in": "path",
  221.                         "description": "Book ID.",
  222.                         "required": true,
  223.                         "type": "integer"
  224.                     },
  225.                     {
  226.                         "name": "limit",
  227.                         "in": "query",
  228.                         "description": "The number of records",
  229.                         "required": false,
  230.                         "type": "integer"
  231.                     },
  232.                     {
  233.                         "name": "offset",
  234.                         "in": "query",
  235.                         "description": "Offset (first record to be displayed)",
  236.                         "required": false,
  237.                         "type": "integer"
  238.                     }
  239.                 ],
  240.                 "responses": {
  241.                     "200": {
  242.                         "description": "Successful response",
  243.                         "schema": {
  244.                             "title": "ArrayOfSubscribers",
  245.                             "type": "array",
  246.                             "items": {
  247.                                 "$ref": "#/definitions/Subscriber"
  248.                             }
  249.                         }
  250.                     },
  251.                     "default": {
  252.                         "description": "Unexpected error",
  253.                         "schema": {
  254.                             "$ref": "#/definitions/Error"
  255.                         }
  256.                     }
  257.                 },
  258.                 "tags": [
  259.                     "books",
  260.                     "subscribers"
  261.                 ]
  262.             }
  263.         }
  264.     },
  265.     "definitions": {
  266.         "AddressBook": {
  267.             "type": "object",
  268.             "properties": {
  269.                 "id": {
  270.                     "type": "string",
  271.                     "description": "Book ID."
  272.                 },
  273.                 "name": {
  274.                     "type": "string",
  275.                     "description": "Book name."
  276.                 },
  277.                 "all_email_qty": {
  278.                     "type": "number",
  279.                     "description": "Total number of emails."
  280.                 },
  281.                 "active_email_qty": {
  282.                     "type": "number",
  283.                     "description": "Number of active emails."
  284.                 },
  285.                 "inactive_email_qty": {
  286.                     "type": "number",
  287.                     "description": "Number of inactive emails."
  288.                 },
  289.                 "creationdate": {
  290.                     "type": "string",
  291.                     "format": "date",
  292.                     "description": "Date of creation."
  293.                 },
  294.                 "status": {
  295.                     "type": "number",
  296.                     "description": "Status code"
  297.                 },
  298.                 "status_explain": {
  299.                     "type": "string",
  300.                     "description": "Status explanation."
  301.                 }
  302.             }
  303.         },
  304.         "Subscriber": {
  305.             "type": "object",
  306.             "properties": {
  307.                 "email": {
  308.                     "type": "string",
  309.                     "format": "email",
  310.                     "description": "Valid email address of subscriber."
  311.                 },
  312.                 "status": {
  313.                     "type": "integer",
  314.                     "description": "Status code."
  315.                 },
  316.                 "status_explain": {
  317.                     "type": "string",
  318.                     "description": "Full status explanation."
  319.                 },
  320.                 "variables": {
  321.                     "type": "object"
  322.                 }
  323.             }
  324.         },
  325.         "Error": {
  326.             "type": "object",
  327.             "properties": {
  328.                 "error": {
  329.                     "type": "string",
  330.                     "description": "Short error description."
  331.                 },
  332.                 "error_code": {
  333.                     "type": "integer",
  334.                     "description": "Error code."
  335.                 },
  336.                 "error_description": {
  337.                     "type": "string",
  338.                     "description": "Detailed error explanation."
  339.                 },
  340.                 "message": {
  341.                     "type": "string",
  342.                     "description": "Fullr error message."
  343.                 }
  344.             }
  345.         },
  346.         "SuccessResult": {
  347.             "type": "object",
  348.             "properties": {
  349.                 "result": {
  350.                     "type": "boolean",
  351.                     "description": "Result status of operation."
  352.                 }
  353.             }
  354.         }
  355.     }
  356. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement