Created
June 16, 2015 15:15
-
-
Save jerzyn/6f8615b810cd821e5b13 to your computer and use it in GitHub Desktop.
This API returns the sentiment value (from 5 to -5) for a given word.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"swagger": "2.0", | |
"info": { | |
"version": "v1", | |
"title": "Sentiment API", | |
"description": "This API returns the sentiment value (from 5 to -5) for a given word.", | |
"contact": { | |
"name": "3scale Support Team", | |
"email": "support@3scale.net", | |
"url": "htpps://support.3scale.net" | |
} | |
}, | |
"host": "sentiment-api.herokuapp.com", | |
"basePath": "/v1/words", | |
"schemes": [ | |
"http" | |
], | |
"produces": [ | |
"application/json" | |
], | |
"paths": { | |
"/{word}.json": { | |
"get": { | |
"description": "<p>This operation returns the sentiment value on a scale from -5 to +5 of the given word.<p>For instance, the word \"awesome\" returns {\"word\":\"awesome\",\"sentiment\":4} with a positive connotation whereas \"damnit\" is less positive {\"word\":\"damnit\",\"sentiment\":-4}", | |
"operationId": "wordsGet", | |
"summary": "Returns the sentiment value of a given word", | |
"parameters": [ | |
{ | |
"name": "word", | |
"description": "The word whose sentiment is returned", | |
"type": "string", | |
"in": "path", | |
"required": true | |
}, | |
{ | |
"name": "access_token", | |
"description": "Your access token", | |
"type": "string", | |
"in": "query", | |
"required": true | |
} | |
] | |
}, | |
"post": { | |
"description": "<p>This operation allows you to set the sentiment value to a word.<p>The sentiment value needs to be on the range -5 to +5.", | |
"operationId": "wordsPost", | |
"summary": "Sets the sentiment value of a given word", | |
"parameters": [ | |
{ | |
"name": "word", | |
"description": "The word whose sentiment is returned", | |
"type": "string", | |
"in": "path", | |
"required": true | |
}, | |
{ | |
"name": "value", | |
"description": "The sentiment value of the word, must be -5 to -1 for negative or to +1 to +5 for positive connotations", | |
"type": "string", | |
"default": "1", | |
"required": true, | |
"in": "query", | |
"enum": [ | |
"-5", | |
"-4", | |
"-3", | |
"-2", | |
"-1", | |
"1", | |
"2", | |
"3", | |
"4", | |
"5" | |
] | |
}, | |
{ | |
"name": "access_token", | |
"description": "Your access token", | |
"type": "string", | |
"in": "query", | |
"required": true | |
} | |
] | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment