{"swagger":"2.0","info":{"description":"2Miners Email Notification Bot API","version":"1.0.0","title":"2Miners Email Notification Bot API","contact":{"email":"slavikus@gmail.com"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"paths":{"/api":{"get":{"summary":"gets user preferences","description":"Gets user preferences for provided pubkey/email/pool combination\n","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"user","description":"user information to fetch preferences for","required":true,"schema":{"$ref":"#/definitions/User"}}],"responses":{"200":{"description":"user preferences for the given credentials","schema":{"$ref":"#/definitions/UserNotificationPreferences"}},"400":{"description":"bad input parameter"},"404":{"description":"user with these credentials not found"}}},"put":{"summary":"creates or updates notification preferences for a given user","description":"Creates or updates user preferences for provided pubkey/email/pool combination\n","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"user","description":"user information to save preferences for","required":true,"schema":{"$ref":"#/definitions/UserNotificationPreferences"}}],"responses":{"200":{"description":"User credentials with email that the confirmation token was sent to and notifications to be stored when token is confirmed","schema":{"$ref":"#/definitions/UserNotificationPreferences"}},"400":{"description":"bad input parameter"}}},"delete":{"summary":"deletes user preferences","description":"Deletes user preferences for provided pubkey/email/pool combination\n","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"user","description":"user information to delete preferences for","required":true,"schema":{"$ref":"#/definitions/User"}}],"responses":{"200":{"description":"user to be deleted once token is confirmed","schema":{"$ref":"#/definitions/User"}},"400":{"description":"bad input parameter"},"404":{"description":"user with these credentials not found"}}}},"/api/token/{token}":{"get":{"summary":"submits user token to confirm the change","description":"Submit user token to confirm the change (create/update preferences or delete the user)\n","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"path","name":"token","description":"token received from the email","required":true,"type":"string"}],"responses":{"200":{"description":"user preferences that were stored for the given token","schema":{"$ref":"#/definitions/UserNotificationPreferences"}},"400":{"description":"bad input parameter"},"404":{"description":"token not found"}}}}},"definitions":{"User":{"type":"object","required":["address","email","pool","releaseDate"],"properties":{"address":{"type":"string","description":"Pubkey of the user (cryptocurrency address)","example":"0x7cf446004bff3da03b278b81b240f71ee88b6e9f"},"email":{"type":"string","format":"email","description":"Email address of the user","example":"elena.golovach@mail.ru"},"pool":{"type":"string","description":"Address of the pool (no http or https prefix)","example":"solo-clo.2miners.com"}}},"UserNotificationPreferences":{"type":"object","properties":{"user":{"$ref":"#/definitions/User"},"alert":{"type":"integer","description":"Time to notify when worker goes down, in minutes","example":10,"default":10},"repeat":{"type":"integer","description":"Time to notify again after the first alert","example":10,"default":0},"newblock":{"type":"boolean","description":"Whether to notify about newly found block","example":false,"default":false},"lang":{"type":"string","description":"Language of notifications. Must be 'ru' or 'en' for the time being.","example":"ru","default":"en"}}}},"host":"virtserver.swaggerhub.com","basePath":"/2masternodes/2miners-email-notifications/1.0.0","schemes":["https"]}