UNPKG

openapi-directory

Version:

Building & bundling https://github.com/APIs-guru/openapi-directory for easy use from JS

1 lines 18.6 kB
{"openapi":"3.0.0","info":{"contact":{"x-twitter":"thesmsworks"},"description":"The SMS Works provides a low-cost, reliable SMS API for developers. Pay only for delivered texts, all failed messages are refunded.","title":"The SMS Works","version":"1.2.0","x-apisguru-categories":["messaging"],"x-logo":{"url":"https://twitter.com/thesmsworks/profile_image?size=original"},"x-origin":[{"format":"swagger","url":"https://api.thesmsworks.co.uk/api/swagger/swagger.yaml","version":"2.0"}],"x-providerName":"thesmsworks.co.uk"},"paths":{"/auth/getApiKey":{"get":{"description":"Generates an API Key/Secret pair","operationId":"keySecret","parameters":[{"description":"The Customer ID","in":"query","name":"customerid","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Success","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/apiKeyResponse"}}}},"default":{"description":"Error","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/ExtendedErrorModel"}}}}},"tags":["auth"]},"x-swagger-router-controller":"authentication"},"/auth/token":{"post":{"description":"Generates a Json Web Token","operationId":"login","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Login"}}},"description":"API Key & Secret","required":true},"responses":{"200":{"description":"Success","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"default":{"description":"Error","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/ExtendedErrorModel"}}}}},"tags":["auth"]},"x-swagger-router-controller":"authentication"},"/batch/schedule":{"post":{"description":"Schedules a batch of SMS messages to be sent at the date time you specify","operationId":"scheduleBatch","requestBody":{"$ref":"#/components/requestBodies/BatchMessage"},"responses":{"201":{"description":"Success","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/ScheduledBatchResponse"}}}},"default":{"description":"Error","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/ExtendedErrorModel"}}}}},"security":[{"JWT":[]}],"tags":["batch messages"]},"x-swagger-router-controller":"smpp-client"},"/batch/send":{"post":{"description":"Send a single SMS message to multiple recipients","operationId":"sendBatch","requestBody":{"$ref":"#/components/requestBodies/BatchMessage"},"responses":{"201":{"description":"Success","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/BatchMessageResponse"}}}},"default":{"description":"Error","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/ExtendedErrorModel"}}}}},"security":[{"JWT":[]}],"tags":["batch messages"]},"x-swagger-router-controller":"smpp-client"},"/batch/{batchid}":{"get":{"description":"Retrieve all messages in a batch with the given batch ID","operationId":"getBatchById","parameters":[{"description":"The ID of the batch you would like returned","in":"path","name":"batchid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/MessagesResponse"}}}},"404":{"description":"Error","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}},"default":{"description":"Error","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"security":[{"JWT":[]}],"tags":["batch messages"]},"x-swagger-router-controller":"smpp-client"},"/batches/schedule/{batchid}":{"delete":{"description":"Cancels a scheduled SMS message","operationId":"cancelScheduledBatchJob","parameters":[{"description":"The ID of the batch you would like returned","in":"path","name":"batchid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/CancelledMessageResponse"}}}},"default":{"description":"Error","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/ExtendedErrorModel"}}}}},"security":[{"JWT":[]}],"tags":["batch messages"]},"x-swagger-router-controller":"smpp-client"},"/credits/balance":{"get":{"description":"Returns the number of credits currently available on the account","operationId":"credits","responses":{"200":{"description":"Success","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/CreditsResponse"}}}},"default":{"description":"Error","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"tags":["credits"]},"x-swagger-router-controller":"account-client"},"/message/schedule":{"post":{"description":"Schedules an SMS message to be sent at the date-time you specify","operationId":"scheduleMessage","requestBody":{"$ref":"#/components/requestBodies/Message"},"responses":{"201":{"description":"Success","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/ScheduledMessageResponse"}}}},"default":{"description":"Error","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/ExtendedErrorModel"}}}}},"security":[{"JWT":[]}],"tags":["messages"]},"x-swagger-router-controller":"smpp-client"},"/message/send":{"post":{"description":"Sends an SMS message","operationId":"sendMessage","requestBody":{"$ref":"#/components/requestBodies/Message"},"responses":{"201":{"description":"Success","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/SendMessageResponse"}}}},"402":{"description":"Error","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/ExtendedErrorModel"}}}},"default":{"description":"Error","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/ExtendedErrorModel"}}}}},"security":[{"JWT":[]}],"tags":["messages"]},"x-swagger-router-controller":"smpp-client"},"/messages":{"post":{"description":"Get messages matching your search criteria","operationId":"getMessages","requestBody":{"$ref":"#/components/requestBodies/Query"},"responses":{"200":{"description":"Success","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/MessagesResponse"}}}},"default":{"description":"Error","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/ExtendedErrorModel"}}}}},"security":[{"JWT":[]}],"tags":["messages"]},"x-swagger-router-controller":"message-client"},"/messages/inbox":{"post":{"description":"Get unread uncoming messages matching your search criteria","operationId":"getInboxMessages","requestBody":{"$ref":"#/components/requestBodies/Query"},"responses":{"200":{"description":"Success","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/MessagesResponse"}}}},"default":{"description":"Error","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/ExtendedErrorModel"}}}}},"security":[{"JWT":[]}],"tags":["messages"]},"x-swagger-router-controller":"message-client"},"/messages/schedule/{messageid}":{"delete":{"description":"Cancels a scheduled SMS message","operationId":"cancelScheduledJob","parameters":[{"description":"The ID of the message you would like returned","in":"path","name":"messageid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/CancelledMessageResponse"}}}},"default":{"description":"Error","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/ExtendedErrorModel"}}}}},"security":[{"JWT":[]}],"tags":["messages"]},"x-swagger-router-controller":"smpp-client"},"/messages/{messageid}":{"get":{"description":"Retrieve a logged message by the message ID","operationId":"getMessageById","parameters":[{"description":"The ID of the message you would like returned","in":"path","name":"messageid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"404":{"description":"Error","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}},"default":{"description":"Error","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"security":[{"JWT":[]}],"tags":["messages"]},"x-swagger-router-controller":"message-client"},"/swagger":{"x-swagger-pipe":"swagger_raw"},"/utils/errors/{errorcode}":{"get":{"description":"Returns a sample error object for the given error code. Useful for designing code to react to errors when they occur for real.","operationId":"getError","parameters":[{"description":"The code of the error you would like returned","in":"path","name":"errorcode","required":true,"schema":{"type":"string"}}],"responses":{"default":{"description":"Error","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/ExtendedErrorModel"}}}}},"tags":["utils"]},"x-swagger-router-controller":"hello-world"},"/utils/test":{"get":{"description":"Returns the customer ID to the caller","operationId":"test","responses":{"200":{"description":"Success","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/TestResponse"}}}},"default":{"description":"Error","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/ErrorModel"}}}}},"tags":["utils"]},"x-swagger-router-controller":"hello-world"}},"servers":[{"url":"https://api.thesmsworks.co.uk/v1"}],"components":{"requestBodies":{"Query":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Query"}}},"required":true},"BatchMessage":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchMessage"}}},"description":"Message properties","required":true},"Message":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}},"description":"Message properties","required":true}},"securitySchemes":{"JWT":{"in":"header","name":"Authorization","type":"apiKey"}},"schemas":{"BatchMessage":{"description":"SMS Message Batch","properties":{"content":{"description":"Message to send to the recipient","example":"My super awesome batch message","type":"string"},"destinations":{"description":"Telephone numbers of each of the recipients","example":["447777777777","447777777778","447777777779"],"items":{"type":"string"},"type":"array"},"schedule":{"description":"Date-time at which to send the batch. This is only used by the batch/schedule service.","example":"Wed Jul 19 2017 20:26:28 GMT+0100 (BST)","type":"string"},"sender":{"description":"The sender of the message. Should be no longer than 11 characters for alphanumeric or 15 characters for numeric sender ID's. No spaces or special characters.","example":"YourCompany","type":"string"},"tag":{"description":"An identifying label for the message, which you can use to filter and report on messages you've sent later. Ideal for campaigns.","example":"SummerSpecial","type":"string"},"ttl":{"description":"The number of minutes before the message is deleted. Optional. Omit to prevent delivery report deletion.","example":10,"type":"number"}},"required":["sender","destinations","content","schedule"]},"BatchMessageResponse":{"properties":{"batchid":{"example":2586749,"type":"string"},"status":{"example":"SCHEDULED","type":"string"}},"required":["batchid","status"]},"CancelledMessageResponse":{"properties":{"messageid":{"example":5620320,"type":"string"},"status":{"example":"CANCELLED","type":"string"}},"required":["messageid","status"]},"CreditsResponse":{"properties":{"credits":{"example":180,"type":"number"}},"required":["credits"]},"ErrorModel":{"properties":{"message":{"type":"string"}},"required":["message"],"type":"object"},"ExtendedErrorModel":{"allOf":[{"$ref":"#/components/schemas/ErrorModel"},{"properties":{"errorCode":{"type":"number"},"permanent":{"type":"boolean"},"status":{"type":"string"}},"required":["errorCode","status"],"type":"object"}]},"Login":{"description":"authorisation object","properties":{"customerid":{"description":"Your customer ID, available from your account area at https://thesmsworks.co.uk/user/login","type":"string"},"key":{"description":"API Key","type":"string"},"secret":{"description":"API Secret","type":"string"}}},"Message":{"description":"SMS message object","properties":{"content":{"description":"Message to send to the recipient. Content can be up to 1280 characters in length. You will be charged 1 credit for each 160 characters, up to a maximum of 8 credits. Messages sent to numbers registered outside the UK will be charged double credits (i.e. 2 credits per 160 characters, up to maximum of 8 credits).","example":"Your super awesome message","type":"string"},"destination":{"description":"Telephone number of the recipient","example":"447777777777","type":"string"},"metadata":{"example":[{"key":"myKey1","value":"myValue1"},{"key":"myKey2","value":"myValue2"}],"items":{"type":"object"},"properties":{"schema":{"$ref":"#/components/schemas/MetaData"}},"type":"array"},"schedule":{"description":"Date at which to send the message. This is only used by the message/schedule service and can be left empty for other services.","example":"Sun Sep 03 2017 15:34:23 GMT+0100 (BST)","type":"string"},"sender":{"description":"The sender of the message. Should be no longer than 11 characters for alphanumeric or 15 characters for numeric sender ID's. No spaces or special characters.","example":"YourCompany","type":"string"},"tag":{"description":"An identifying label for the message, which you can use to filter and report on messages you've sent later. Ideal for campaigns.","example":"SummerSpecial","type":"string"},"ttl":{"description":"The number of minutes before the message is deleted. Optional. Omit to prevent delivery report deletion.","example":10,"type":"number"}},"required":["sender","destination","content","schedule"]},"MessageResponse":{"properties":{"batchid":{"example":"2586749","type":"string"},"content":{"example":"My super awesome message","type":"string"},"created":{"example":"Wed Jul 19 2017 20:53:46 GMT+0100 (BST)","type":"string"},"customerid":{"example":"0fca8c3c-6cbc-11e7-8154-a6006ad3dba0","type":"string"},"destination":{"example":"447777777777","type":"number"},"failurereason":{"properties":{"code":{"example":34,"type":"number"},"details":{"example":"Handset error","type":"string"},"permanent":{"example":false,"type":"boolean"}},"type":"object"},"id":{"example":123456789,"type":"string"},"keyword":{"example":"SOLO","type":"string"},"messageid":{"example":123456789,"type":"string"},"modified":{"example":"Wed Jul 19 2017 20:53:49 GMT+0100 (BST)","type":"string"},"schedule":{"example":"Wed Jul 19 2017 20:53:45 GMT+0100 (BST)","type":"string"},"sender":{"example":"YourCompany","type":"string"},"status":{"example":"DELIVERED","type":"string"},"tag":{"example":"campaign2","type":"string"}},"required":["batchid","content","created","customerid","destination","keyword","messageid","modified","schedule","status","sender","tag"]},"MessagesResponse":{"properties":{"messages":{"items":{"type":"object"},"properties":{"schema":{"$ref":"#/components/schemas/MessageResponse"}},"type":"array"}},"required":["messages"]},"MetaData":{"description":"Key/value pair that will be returned to you in the API call response.","properties":{"key":{"description":"key of the key/value pair","example":"myKey","type":"string"},"value":{"description":"value of the key/value pair","example":"myValue","type":"string"}}},"Query":{"description":"search parameters for querying the message database","properties":{"destination":{"description":"The phone number of the recipient. Start UK numbers with 44 and drop the leading 0.","example":"447777777777","type":"string"},"from":{"description":"The date-time from which you would like matching messages","example":"Wed Jul 12 2017 20:26:28 GMT+0100 (BST)","type":"string"},"keyword":{"description":"The keyword used in the inbound message","example":"SKYWALKER","type":"string"},"metadata":{"description":"An array of objects containing metadata key/value pairs that have been saved on messages.","example":[{"key":"myKey1","value":"myValue1"},{"key":"myKey2","value":"myValue2"}],"items":{"type":"object"},"properties":{"schema":{"$ref":"#/components/schemas/MetaData"}},"type":"array"},"sender":{"description":"The sender of the message (this can be the configured sender name for an outbound message or the senders phone number for an inbound message).","example":"YourCompany","type":"string"},"status":{"description":"The status of the messages you would like returned (either 'SENT', 'DELIVERED', 'EXPIRED', 'DELETED', 'UNDELIVERABLE', 'ACCEPTED', 'UNKNOWN', 'REJECTED')","example":"SENT","type":"string"},"to":{"description":"The date-time to which you would like matching messages","example":"Wed Jul 19 2017 20:26:28 GMT+0100 (BST)","type":"string"}}},"ScheduledBatchResponse":{"properties":{"batchid":{"example":3200562,"type":"string"},"status":{"example":"SCHEDULED","type":"string"}},"required":["batchid","status"]},"ScheduledMessageResponse":{"properties":{"messageid":{"example":123456789,"type":"string"},"status":{"example":"SCHEDULED","type":"string"}},"required":["messageid","status"]},"SendMessageResponse":{"properties":{"credits":{"example":180,"type":"number"},"messageid":{"example":123456789,"type":"string"},"status":{"example":"SENT","type":"string"}},"required":["messageid","status","credits"]},"TestResponse":{"properties":{"message":{"type":"string"}},"required":["message"]},"TokenResponse":{"properties":{"token":{"example":"JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJPbmxpbmUgSldUIEJ1aWxkZXIiLCJpYXQiOjE1MDA0OTU2NjEsImV4cCI6MTUzMjAzMTY2MSwiYXVkIjoid3d3LmV4YW1wbGUuY29tIiwic3ViIjoianJvY2tldEBleGFtcGxlLmNvbSIsIkdpdmVuTmFtZSI6IkpvaG5ueSIsIlN1cm5hbWUiOiJSb2NrZXQiLCJFbWFpbCI6Impyb2NrZXRAZXhhbXBsZS5jb20iLCJSb2xlIjpbIk1hbmFnZXIiLCJQcm9qZWN0IEFkbWluaXN0cmF0b3IiXX0.BR1BIDy0Mw3R4ilfqAojsnh7bp_pgeX2jfjhhZyaexQ","type":"string"}},"required":["token"]},"apiKeyResponse":{"properties":{"key":{"example":"22795661-48a1-442d-92a3-bc2384836fad","type":"string"},"secret":{"example":"10045176307448ced2e1b74963d137f2bfaefbdad6fe415df429b64c4d63b856","type":"string"}},"required":["key","secret"]}}}}