wordnik 0.4.5 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
data/api_docs/word.json CHANGED
@@ -1 +1 @@
1
- {"endPoints":[{"path":"/word.{format}/{word}","description":"","operations":[{"parameters":[{"name":"word","description":"String value of WordObject to return","required":true,"paramType":"path"},{"name":"useCanonical","description":"If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.","required":false,"paramType":"query"},{"name":"includeSuggestions","description":"Return suggestions (for correct spelling, case variants, etc.)","required":false,"paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"wordObject","errorResponses":[{"reason":"Invalid word supplied.","code":400}],"condition":"any"}],"summary":"Given a word as a string, returns the WordObject that represents it","open":false,"httpMethod":"GET"}]},{"path":"/word.{format}/{word}/examples","description":"","operations":[{"parameters":[{"name":"word","description":"Word to return examples for","required":true,"paramType":"path"},{"name":"limit","description":"Maximum number of results to return","required":false,"paramType":"query"},{"name":"includeDuplicates","description":"Show duplicate examples from different sources","required":false,"paramType":"query"},{"name":"contentProvider","description":"Return results from a specific ContentProvider","required":false,"paramType":"query"},{"name":"useCanonical","description":"If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.","required":false,"paramType":"query"},{"name":"skip","description":"Results to skip","required":false,"paramType":"query"},{"name":"limit","description":"Maximum number of results to return","required":false,"paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"exampleSearchResults","errorResponses":[{"reason":"Invalid word supplied.","code":400}],"condition":"any"}],"summary":"Returns examples for a word","open":false,"httpMethod":"GET"}]},{"path":"/word.{format}/{word}/definitions","description":"","operations":[{"parameters":[{"name":"word","description":"Word to return definitions for","required":true,"paramType":"path"},{"name":"limit","description":"Maximum number of results to return","required":false,"paramType":"query"},{"name":"partOfSpeech","description":"CSV list of part-of-speech types","required":false,"allowableValues":"noun,adjective,verb,adverb,interjection,pronoun,preposition,abbreviation,affix,article,auxiliary-verb,conjunction,definite-article,family-name,given-name,idiom,imperative,noun-plural,noun-posessive,past-participle,phrasal-prefix,proper-noun,proper-noun-plural,proper-noun-posessive,suffix,verb-intransitive,verb-transitive","paramType":"query"},{"name":"includeRelated","description":"Return related words with definitions","required":false,"allowableValues":"true,false","paramType":"query"},{"name":"sourceDictionaries","description":"Gets from dictionaries in the supplied order of precedence","required":false,"allowableValues":"ahd, century, wiktionary, webster, wordnet","paramType":"query"},{"name":"useCanonical","description":"If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.","required":false,"allowableValues":"false,true","paramType":"query"},{"name":"includeTags","description":"Return a closed set of XML tags in response","required":false,"allowableValues":"false,true","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"List[definition]","errorResponses":[{"reason":"Invalid word supplied.","code":400},{"reason":"No definitions found.","code":404}],"condition":"any"}],"summary":"Return definitions for a word","open":false,"httpMethod":"GET"}]},{"path":"/word.{format}/{word}/frequency","description":"","operations":[{"parameters":[{"name":"word","description":"Word to return","required":true,"paramType":"path"},{"name":"useCanonical","description":"If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.","required":false,"paramType":"query"},{"name":"startYear","description":"Starting Year","required":false,"paramType":"query"},{"name":"endYear","description":"Ending Year","required":false,"paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"frequencySummary","errorResponses":[{"reason":"Invalid word supplied.","code":400},{"reason":"No results.","code":404}],"condition":"any"},{"valueType":"frequencySummaryE","errorResponses":[{"reason":"Invalid word supplied.","code":400},{"reason":"No results.","code":404}],"condition":"errorBars=true"}],"summary":"Returns word usage over time","open":false,"httpMethod":"GET"}]},{"path":"/word.{format}/{word}/topExample","description":"","operations":[{"parameters":[{"name":"word","description":"Word to fetch examples for","required":true,"paramType":"path"},{"name":"contentProvider","description":"Return results from a specific ContentProvider","required":false,"paramType":"query"},{"name":"useCanonical","description":"If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.","required":false,"paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"example","errorResponses":[{"reason":"Invalid word supplied.","code":400}],"condition":"any"}],"summary":"Returns a top example for a word","open":false,"httpMethod":"GET"}]},{"path":"/word.{format}/{word}/related","description":"","operations":[{"parameters":[{"name":"word","description":"Word for which to return related words","required":true,"paramType":"path"},{"name":"partOfSpeech","description":"CSV list of part-of-speech types","required":false,"allowableValues":"noun,adjective,verb,adverb,interjection,pronoun,preposition,abbreviation,affix,article,auxiliary-verb,conjunction,definite-article,family-name,given-name,idiom,imperative,noun-plural,noun-posessive,past-participle,phrasal-prefix,proper-noun,proper-noun-plural,proper-noun-posessive,suffix,verb-intransitive,verb-transitive","paramType":"query"},{"name":"sourceDictionary","description":"Get data from a single dictionary. Valid options are ahd, century, wiktionary, webster, and wordnet.","required":false,"paramType":"query"},{"name":"limit","description":"Maximum number of results to return","required":false,"paramType":"query"},{"name":"useCanonical","description":"If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.","required":false,"allowableValues":"false,true","paramType":"query"},{"name":"type","description":"Relationship type","required":false,"allowableValues":"synonym,antonym,variant,equivalent,cross-reference,related-word,rhyme,form,etymologically-related-term,hypernym,hyponym,inflected-form,primary,same-context,verb-form,verb-stem,unknown","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"List[related]","errorResponses":[{"reason":"Invalid word supplied.","code":400},{"reason":"No definitions found.","code":404}],"condition":"any"}],"summary":"Return related words (thesaurus data) for a word","open":false,"httpMethod":"GET"}]},{"path":"/word.{format}/{word}/phrases","description":"","operations":[{"parameters":[{"name":"word","description":"Word to fetch phrases for","required":true,"paramType":"path"},{"name":"limit","description":"Maximum number of results to return","required":false,"paramType":"query"},{"name":"wlmi","description":"Minimum WLMI for the phrase","required":false,"paramType":"query"},{"name":"useCanonical","description":"If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.","required":false,"paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"List[bigram]","errorResponses":[{"reason":"Invalid word supplied.","code":400}],"condition":"any"}],"summary":"Fetches bi-gram phrases for a word","open":false,"httpMethod":"GET"}]},{"path":"/word.{format}/{word}/hyphenation","description":"","operations":[{"parameters":[{"name":"word","description":"Word to get syllables for","required":true,"paramType":"path"},{"name":"useCanonical","description":"If true will try to return a correct word root ('cats' -> 'cat'). If false returns exactly what was requested.","required":false,"paramType":"query"},{"name":"sourceDictionary","description":"Get from a single dictionary. Valid options: ahd, century, wiktionary, webster, and wordnet.","required":false,"paramType":"query"},{"name":"limit","description":"Maximum number of results to return","required":false,"paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"List[syllable]","errorResponses":[{"reason":"Invalid word supplied.","code":400}],"condition":"any"}],"summary":"Returns syllable information for a word","open":false,"httpMethod":"GET"}]},{"path":"/word.{format}/{word}/pronunciations","description":"","operations":[{"parameters":[{"name":"word","description":"Word to get pronunciations for","required":true,"paramType":"path"},{"name":"useCanonical","description":"If true will try to return a correct word root ('cats' -> 'cat'). If false returns exactly what was requested.","required":false,"paramType":"query"},{"name":"sourceDictionary","description":"Get from a single dictionary.","required":false,"allowableValues":"ahd,century,cmu,wiktionary,webster,wordnet","paramType":"query"},{"name":"typeFormat","description":"Text pronunciation type","required":false,"allowableValues":"ahd,arpabet,gcide-diacritical","paramType":"query"},{"name":"limit","description":"Maximum number of results to return","required":false,"paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"List[textPron]","errorResponses":[{"reason":"Invalid word supplied.","code":400}],"condition":"any"}],"summary":"Returns text pronunciations for a given word","open":false,"httpMethod":"GET"}]},{"path":"/word.{format}/{word}/audio","description":"","operations":[{"parameters":[{"name":"word","description":"Word to get audio for.","required":true,"paramType":"path"},{"name":"useCanonical","description":"Use the canonical form of the word.","required":false,"paramType":"query"},{"name":"limit","description":"Maximum number of results to return","required":false,"paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"List[audioObject]","errorResponses":[{"reason":"Invalid word supplied.","code":400}],"condition":"any"},{"valueType":"List[audioFile]","errorResponses":[{"reason":"Invalid word supplied.","code":400}],"condition":"any"}],"summary":"Fetches audio metadata for a word.","open":false,"notes":"The metadata includes a time-expiring fileUrl which allows reading the audio file directly from the API. Currently only audio pronunciations from the American Heritage Dictionary in mp3 format are supported.","httpMethod":"GET"}]}],"models":[{"name":"note","fields":[{"name":"noteType","description":"Contains the type of note","required":false,"allowableValues":"x, y, z","internalDescription":"Need to replace x, y z","paramAccess":"open","paramType":"string"},{"name":"pos","required":false,"paramType":"int"},{"name":"value","required":false,"paramType":"string"},{"name":"appliesTo","required":false,"paramType":"List[string]"}]},{"name":"example","fields":[{"name":"year","required":false,"paramType":"integer"},{"name":"provider","required":false,"paramType":"contentProvider"},{"name":"url","required":false,"paramType":"string"},{"name":"word","required":false,"paramType":"string"},{"name":"text","required":false,"paramType":"string"},{"name":"title","required":false,"paramType":"string"},{"name":"rating","required":false,"paramType":"float"},{"name":"exampleId","required":false,"paramType":"long"},{"name":"documentId","required":false,"paramType":"long"}]},{"name":"definition","fields":[{"name":"exampleUsage","required":false,"wrapperName":"exampleUses","paramType":"List[ExampleUsage]"},{"name":"word","required":false,"paramType":"string"},{"name":"text","required":false,"paramType":"string"},{"name":"textPron","required":false,"wrapperName":"textProns","paramType":"List[textPron]"},{"name":"partOfSpeech","required":false,"paramType":"string"},{"name":"note","required":false,"wrapperName":"notes","paramType":"List[note]"},{"name":"citation","required":false,"wrapperName":"citations","paramType":"List[citation]"},{"name":"relWord","required":false,"wrapperName":"relatedWords","paramType":"List[related]"},{"name":"sourceDictionary","required":false,"paramType":"string"},{"name":"label","required":false,"wrapperName":"labels","paramType":"List[Label]"},{"name":"sequence","required":false,"paramType":"string"},{"name":"seqString","required":false,"paramType":"string"},{"name":"extendedText","required":false,"paramType":"string"}]},{"name":"frequency","fields":[{"name":"year","required":false,"paramType":"int"},{"name":"count","required":false,"paramType":"long"}]},{"name":"contentProvider","fields":[{"name":"name","required":false,"paramType":"string"},{"name":"id","required":false,"paramType":"int"}]},{"name":"audioType","fields":[{"name":"name","required":false,"paramType":"string"},{"name":"id","required":false,"paramType":"int"}]},{"name":"ExampleUsage","fields":[{"name":"text","required":false,"paramType":"string"}]},{"name":"frequencySummary","fields":[{"name":"word","required":false,"paramType":"string"},{"name":"totalCount","required":false,"paramType":"long"},{"name":"frequency","required":false,"paramType":"List[frequency]"},{"name":"unknownYearCount","required":false,"paramType":"int"},{"name":"countForYear","required":false,"paramType":"long"}]},{"name":"citation","fields":[{"name":"source","required":false,"paramType":"string"},{"name":"cite","required":false,"paramType":"string"}]},{"name":"audioType","fields":[{"name":"name","required":false,"paramType":"string"},{"name":"id","required":false,"paramType":"int"}]},{"name":"scoredWord","fields":[{"name":"id","required":false,"paramType":"long"},{"name":"wordType","required":false,"paramType":"string"},{"name":"position","required":false,"paramType":"int"},{"name":"word","required":false,"paramType":"string"},{"name":"score","required":false,"paramType":"float"},{"name":"sentenceId","required":false,"paramType":"long"},{"name":"partOfSpeech","required":false,"paramType":"string"}]},{"name":"facetValue","fields":[{"name":"value","required":false,"paramType":"string"},{"name":"count","required":false,"paramType":"long"}]},{"name":"sentence","fields":[{"name":"id","required":false,"paramType":"long"},{"name":"scoredWord","required":false,"wrapperName":"scoredWords","paramType":"List[scoredWord]"},{"name":"display","required":false,"paramType":"string"},{"name":"documentMetadataId","required":false,"paramType":"long"},{"name":"rating","required":false,"paramType":"int"}]},{"name":"facet","fields":[{"name":"name","required":false,"paramType":"string"},{"name":"facetValue","required":false,"wrapperName":"facetValues","paramType":"List[facetValue]"}]},{"name":"wordObject","fields":[{"name":"word","required":false,"paramType":"string"},{"name":"vulgar","required":false,"paramType":"string"}]},{"name":"bigram","fields":[{"name":"count","required":false,"paramType":"long"},{"name":"gram1","required":false,"paramType":"string"},{"name":"gram2","required":false,"paramType":"string"},{"name":"mi","required":false,"paramType":"double"},{"name":"wlmi","required":false,"paramType":"double"}]},{"name":"related","fields":[{"name":"word","required":false,"wrapperName":"words","paramType":"List[string]"},{"name":"relationshipType","required":false,"paramType":"string"},{"name":"label1","required":false,"paramType":"string"},{"name":"label2","required":false,"paramType":"string"},{"name":"label3","required":false,"paramType":"string"},{"name":"label4","required":false,"paramType":"string"},{"name":"gram","required":false,"paramType":"string"}]},{"name":"exampleSearchResults","fields":[{"name":"facet","required":false,"wrapperName":"facets","paramType":"List[facet]"},{"name":"example","required":false,"wrapperName":"examples","paramType":"List[example]"},{"name":"totalResults","required":false,"paramType":"int"}]},{"name":"frequencySummaryE","fields":[{"name":"elements","required":false,"paramType":"List[frequencyElement]"}]},{"name":"partOfSpeech","fields":[{"name":"roots","required":false,"paramType":"List[root]"}]},{"name":"syllable","fields":[{"name":"type","required":false,"paramType":"string"},{"name":"seq","required":false,"paramType":"int"},{"name":"text","required":false,"paramType":"string"}]},{"name":"textPron","fields":[{"name":"id","required":false,"paramType":"long"},{"name":"seq","required":false,"paramType":"int"},{"name":"raw","required":false,"paramType":"string"},{"name":"rawType","required":false,"paramType":"string"}]},{"name":"Label","fields":[{"name":"type","required":false,"paramType":"string"},{"name":"text","required":false,"paramType":"string"}]},{"name":"audioFile","fields":[{"name":"id","required":true,"paramType":"long"},{"name":"description","required":false,"paramType":"string"},{"name":"createdBy","required":false,"paramType":"string"},{"name":"word","required":false,"paramType":"string"},{"name":"createdAt","required":false,"paramType":"Date"},{"name":"commentCount","required":false,"paramType":"int"},{"name":"voteCount","required":false,"paramType":"integer"},{"name":"voteAverage","required":false,"paramType":"float"},{"name":"voteWeightedAverage","required":false,"paramType":"float"},{"name":"fileUrl","required":false,"paramType":"string"}]},{"name":"frequencyElement","fields":[{"name":"year","required":false,"paramType":"int"},{"name":"lowerWisker","required":false,"paramType":"double"},{"name":"upperWisker","required":false,"paramType":"double"},{"name":"lowerBox","required":false,"paramType":"double"},{"name":"upperBox","required":false,"paramType":"double"}]},{"name":"audioObject","fields":[{"name":"id","required":false,"paramType":"long"},{"name":"type","required":false,"paramType":"audioType"},{"name":"description","required":false,"paramType":"string"},{"name":"userId","required":false,"paramType":"long"},{"name":"createdBy","required":false,"paramType":"string"},{"name":"wordstring","required":false,"paramType":"string"},{"name":"wordId","required":false,"paramType":"long"},{"name":"createdAt","required":false,"paramType":"Date"},{"name":"filePath","required":false,"paramType":"string"},{"name":"recordId","required":false,"paramType":"string"},{"name":"audioFileType","required":false,"paramType":"audioType"},{"name":"audioFileId","required":false,"paramType":"long"},{"name":"streamPath","required":false,"paramType":"string"}]}]}
1
+ {"endPoints":[{"path":"/word.{format}/{word}","description":"","operations":[{"parameters":[{"name":"word","description":"String value of WordObject to return","required":true,"dataType":"string","paramType":"path"},{"name":"useCanonical","description":"If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.","required":false,"dataType":"string","paramType":"query"},{"name":"includeSuggestions","description":"Return suggestions (for correct spelling, case variants, etc.)","required":false,"dataType":"string","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"wordObject","errorResponses":[{"reason":"Invalid word supplied.","code":400}],"condition":"any"}],"category":"WordDetails","summary":"Given a word as a string, returns the WordObject that represents it","suggestedName":"getWord","deprecated":false,"open":false,"httpMethod":"GET"}]},{"path":"/word.{format}/{word}/examples","description":"","operations":[{"parameters":[{"name":"word","description":"Word to return examples for","required":true,"dataType":"string","paramType":"path"},{"name":"limit","description":"Maximum number of results to return","required":false,"dataType":"string","paramType":"query"},{"name":"includeDuplicates","description":"Show duplicate examples from different sources","required":false,"dataType":"string","paramType":"query"},{"name":"contentProvider","description":"Return results from a specific ContentProvider","required":false,"dataType":"string","paramType":"query"},{"name":"useCanonical","description":"If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.","required":false,"dataType":"string","paramType":"query"},{"name":"skip","description":"Results to skip","required":false,"dataType":"string","paramType":"query"},{"name":"limit","description":"Maximum number of results to return","required":false,"dataType":"string","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"exampleSearchResults","errorResponses":[{"reason":"Invalid word supplied.","code":400}],"condition":"any"}],"category":"Examples","summary":"Returns examples for a word","suggestedName":"getExamples","deprecated":false,"open":false,"httpMethod":"GET"}]},{"path":"/word.{format}/{word}/definitions","description":"","operations":[{"parameters":[{"name":"word","description":"Word to return definitions for","required":true,"dataType":"string","paramType":"path"},{"name":"limit","description":"Maximum number of results to return","required":false,"dataType":"string","paramType":"query"},{"name":"partOfSpeech","description":"CSV list of part-of-speech types","required":false,"dataType":"string","allowableValues":"noun,adjective,verb,adverb,interjection,pronoun,preposition,abbreviation,affix,article,auxiliary-verb,conjunction,definite-article,family-name,given-name,idiom,imperative,noun-plural,noun-posessive,past-participle,phrasal-prefix,proper-noun,proper-noun-plural,proper-noun-posessive,suffix,verb-intransitive,verb-transitive","paramType":"query"},{"name":"includeRelated","description":"Return related words with definitions","required":false,"dataType":"string","allowableValues":"true,false","paramType":"query"},{"name":"sourceDictionaries","description":"Gets from dictionaries in the supplied order of precedence","required":false,"dataType":"string","allowableValues":"ahd, century, wiktionary, webster, wordnet","paramType":"query"},{"name":"useCanonical","description":"If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.","required":false,"dataType":"string","allowableValues":"false,true","paramType":"query"},{"name":"includeTags","description":"Return a closed set of XML tags in response","required":false,"dataType":"string","allowableValues":"false,true","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"List[definition]","errorResponses":[{"reason":"Invalid word supplied.","code":400},{"reason":"No definitions found.","code":404}],"condition":"any"}],"category":"DictionaryInfo","summary":"Return definitions for a word","suggestedName":"getDefinitions","deprecated":false,"open":false,"httpMethod":"GET"}]},{"path":"/word.{format}/{word}/frequency","description":"","operations":[{"parameters":[{"name":"word","description":"Word to return","required":true,"dataType":"string","paramType":"path"},{"name":"useCanonical","description":"If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.","required":false,"dataType":"string","paramType":"query"},{"name":"startYear","description":"Starting Year","required":false,"dataType":"string","paramType":"query"},{"name":"endYear","description":"Ending Year","required":false,"dataType":"string","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"frequencySummary","errorResponses":[{"reason":"Invalid word supplied.","code":400},{"reason":"No results.","code":404}],"condition":"any"},{"valueType":"frequencySummaryE","errorResponses":[{"reason":"Invalid word supplied.","code":400},{"reason":"No results.","code":404}],"condition":"errorBars=true"}],"category":"Statistics","summary":"Returns word usage over time","suggestedName":"getWordFrequency","deprecated":false,"open":false,"httpMethod":"GET"}]},{"path":"/word.{format}/{word}/topExample","description":"","operations":[{"parameters":[{"name":"word","description":"Word to fetch examples for","required":true,"dataType":"string","paramType":"path"},{"name":"contentProvider","description":"Return results from a specific ContentProvider","required":false,"dataType":"string","paramType":"query"},{"name":"useCanonical","description":"If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.","required":false,"dataType":"string","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"example","errorResponses":[{"reason":"Invalid word supplied.","code":400}],"condition":"any"}],"category":"Examples","summary":"Returns a top example for a word","suggestedName":"getTopExample","deprecated":false,"open":false,"httpMethod":"GET"}]},{"path":"/word.{format}/{word}/related","description":"","operations":[{"parameters":[{"name":"word","description":"Word for which to return related words","required":true,"dataType":"string","paramType":"path"},{"name":"partOfSpeech","description":"CSV list of part-of-speech types","required":false,"dataType":"string","allowableValues":"noun,adjective,verb,adverb,interjection,pronoun,preposition,abbreviation,affix,article,auxiliary-verb,conjunction,definite-article,family-name,given-name,idiom,imperative,noun-plural,noun-posessive,past-participle,phrasal-prefix,proper-noun,proper-noun-plural,proper-noun-posessive,suffix,verb-intransitive,verb-transitive","paramType":"query"},{"name":"sourceDictionary","description":"Get data from a single dictionary. Valid options are ahd, century, wiktionary, webster, and wordnet.","required":false,"dataType":"string","paramType":"query"},{"name":"limit","description":"Maximum number of results to return","required":false,"dataType":"string","paramType":"query"},{"name":"useCanonical","description":"If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.","required":false,"dataType":"string","allowableValues":"false,true","paramType":"query"},{"name":"type","description":"Relationship type","required":false,"dataType":"string","allowableValues":"synonym,antonym,variant,equivalent,cross-reference,related-word,rhyme,form,etymologically-related-term,hypernym,hyponym,inflected-form,primary,same-context,verb-form,verb-stem,unknown","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"List[related]","errorResponses":[{"reason":"Invalid word supplied.","code":400},{"reason":"No definitions found.","code":404}],"condition":"any"}],"category":"DictionaryInfo","summary":"Return related words (thesaurus data) for a word","suggestedName":"getRelatedWords","deprecated":false,"open":false,"httpMethod":"GET"}]},{"path":"/word.{format}/{word}/phrases","description":"","operations":[{"parameters":[{"name":"word","description":"Word to fetch phrases for","required":true,"dataType":"string","paramType":"path"},{"name":"limit","description":"Maximum number of results to return","required":false,"dataType":"string","paramType":"query"},{"name":"wlmi","description":"Minimum WLMI for the phrase","required":false,"dataType":"string","paramType":"query"},{"name":"useCanonical","description":"If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.","required":false,"dataType":"string","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"List[bigram]","errorResponses":[{"reason":"Invalid word supplied.","code":400}],"condition":"any"}],"category":"Examples","summary":"Fetches bi-gram phrases for a word","suggestedName":"getPhrases","deprecated":false,"open":false,"httpMethod":"GET"}]},{"path":"/word.{format}/{word}/hyphenation","description":"","operations":[{"parameters":[{"name":"word","description":"Word to get syllables for","required":true,"dataType":"string","paramType":"path"},{"name":"useCanonical","description":"If true will try to return a correct word root ('cats' -> 'cat'). If false returns exactly what was requested.","required":false,"dataType":"string","paramType":"query"},{"name":"sourceDictionary","description":"Get from a single dictionary. Valid options: ahd, century, wiktionary, webster, and wordnet.","required":false,"dataType":"string","paramType":"query"},{"name":"limit","description":"Maximum number of results to return","required":false,"dataType":"string","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"List[syllable]","errorResponses":[{"reason":"Invalid word supplied.","code":400}],"condition":"any"}],"category":"WordDetails","summary":"Returns syllable information for a word","suggestedName":"getHyphenation","deprecated":false,"open":false,"httpMethod":"GET"}]},{"path":"/word.{format}/{word}/pronunciations","description":"","operations":[{"parameters":[{"name":"word","description":"Word to get pronunciations for","required":true,"dataType":"string","paramType":"path"},{"name":"useCanonical","description":"If true will try to return a correct word root ('cats' -> 'cat'). If false returns exactly what was requested.","required":false,"dataType":"string","paramType":"query"},{"name":"sourceDictionary","description":"Get from a single dictionary.","required":false,"dataType":"string","allowableValues":"ahd,century,cmu,macmillan,wiktionary,webster,wordnet","paramType":"query"},{"name":"typeFormat","description":"Text pronunciation type","required":false,"dataType":"string","allowableValues":"ahd,arpabet,gcide-diacritical,IPA","paramType":"query"},{"name":"limit","description":"Maximum number of results to return","required":false,"dataType":"string","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"List[textPron]","errorResponses":[{"reason":"Invalid word supplied.","code":400}],"condition":"any"}],"category":"WordDetails","summary":"Returns text pronunciations for a given word","suggestedName":"getTextPronunciations","deprecated":false,"open":false,"httpMethod":"GET"}]},{"path":"/word.{format}/{word}/wordForms","description":"","operations":[{"parameters":[{"name":"word","description":"Word to fetch forms for","required":true,"dataType":"string","paramType":"path"},{"name":"useCanonical","description":"If true will try to return a correct word root ('cats' -> 'cat'). If false returns exactly what was requested.","required":false,"dataType":"string","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"relationshipMap","errorResponses":[{"reason":"Invalid word supplied.","code":400},{"reason":"No results.","code":404}],"condition":"any"}],"category":"WordDetails","summary":"Returns other forms of a word","suggestedName":"getWordForms","deprecated":false,"open":false,"httpMethod":"GET"}]},{"path":"/word.{format}/{word}/audio","description":"","operations":[{"parameters":[{"name":"word","description":"Word to get audio for.","required":true,"dataType":"string","paramType":"path"},{"name":"useCanonical","description":"Use the canonical form of the word.","required":false,"dataType":"string","paramType":"query"},{"name":"limit","description":"Maximum number of results to return","required":false,"dataType":"string","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"List[audioObject]","errorResponses":[{"reason":"Invalid word supplied.","code":400}],"condition":"any"},{"valueType":"List[audioFile]","errorResponses":[{"reason":"Invalid word supplied.","code":400}],"condition":"any"}],"category":"AudioInfo","summary":"Fetches audio metadata for a word.","suggestedName":"getAudio","deprecated":false,"open":false,"notes":"The metadata includes a time-expiring fileUrl which allows reading the audio file directly from the API. Currently only audio pronunciations from the American Heritage Dictionary in mp3 format are supported.","httpMethod":"GET"}]},{"path":"/word.{format}/{word}/contextualLookup","description":"","operations":[{"parameters":[{"name":"word","description":"Word to return definitions for","required":true,"dataType":"string","paramType":"path"},{"name":"sentence","description":"The sentence in which the word occurs","required":true,"dataType":"string","paramType":"query"},{"name":"offset","defaultValue":"-1","description":"The start character offset of the word in the given sentence","required":false,"dataType":"int","allowableValues":"0 to 4096","paramType":"query"},{"name":"expandTerms","description":"Expand context terms using related words","required":false,"dataType":"string","allowableValues":"true,false","paramType":"query"},{"name":"includeSourceDictionaries","description":"Only include these comma-delimited source dictionaries","required":false,"dataType":"string","allowableValues":"ahd, century, wiktionary, webster, wordnet","paramType":"query"},{"name":"excludeSourceDictionaries","description":"Exclude these comma-delimited source dictionaries","required":false,"dataType":"string","allowableValues":"ahd, century, wiktionary, webster, wordnet","paramType":"query"},{"name":"skip","defaultValue":"0","description":"Results to skip","required":false,"dataType":"string","allowableValues":"0 to 1000","paramType":"query"},{"name":"limit","defaultValue":"10","description":"Maximum number of results to return","required":false,"dataType":"string","allowableValues":"1 to 1000","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"DefinitionSearchResults","errorResponses":[{"reason":"Invalid word supplied.","code":400}],"condition":"any"}],"category":"DictionaryInfo","summary":"Returns definitions for a word based on the sentence in which it is found","suggestedName":"contextualLookup","deprecated":false,"open":false,"notes":"Use the offset parameter when the word occurs more than once in the sentence","httpMethod":"GET"}]},{"path":"/word.{format}/{word}/contextualLookup","description":"","operations":[{"parameters":[{"name":"word","description":"Word to return definitions for","required":true,"dataType":"string","paramType":"path"},{"description":"The sentence in which the word occurs","required":true,"dataType":"string","paramType":"body"},{"name":"offset","defaultValue":"-1","description":"The start character offset of the word in the given sentence","required":false,"dataType":"int","allowableValues":"0 to 4096","paramType":"query"},{"name":"expandTerms","description":"Expand context terms using related words","required":false,"dataType":"string","allowableValues":"true,false","paramType":"query"},{"name":"includeSourceDictionaries","description":"Only include these comma-delimited source dictionaries","required":false,"dataType":"string","allowableValues":"ahd, century, wiktionary, webster, wordnet","paramType":"query"},{"name":"excludeSourceDictionaries","description":"Exclude these comma-delimited source dictionaries","required":false,"dataType":"string","allowableValues":"ahd, century, wiktionary, webster, wordnet","paramType":"query"},{"name":"skip","defaultValue":"0","description":"Results to skip","required":false,"dataType":"string","allowableValues":"0 to 1000","paramType":"query"},{"name":"limit","defaultValue":"10","description":"Maximum number of results to return","required":false,"dataType":"string","allowableValues":"1 to 1000","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"DefinitionSearchResults","errorResponses":[{"reason":"Invalid term supplied.","code":400}],"condition":"any"}],"category":"DictionaryInfo","summary":"Returns definitions for a word based on the sentence in which it is found","suggestedName":"contextualLookupPost","deprecated":false,"open":false,"notes":"Use the offset parameter when the word occurs more than once in the sentence","httpMethod":"POST"}]}],"models":[{"name":"note","fields":[{"name":"noteType","description":"Contains the type of note","required":false,"allowableValues":"x, y, z","internalDescription":"Need to replace x, y z","paramAccess":"open","paramType":"string"},{"name":"pos","required":false,"paramType":"int"},{"name":"value","required":false,"paramType":"string"},{"name":"appliesTo","required":false,"paramType":"List[string]"}]},{"name":"example","fields":[{"name":"year","required":false,"paramType":"integer"},{"name":"provider","required":false,"paramType":"contentProvider"},{"name":"url","required":false,"paramType":"string"},{"name":"word","required":false,"paramType":"string"},{"name":"text","required":false,"paramType":"string"},{"name":"title","required":false,"paramType":"string"},{"name":"rating","required":false,"paramType":"float"},{"name":"exampleId","required":false,"paramType":"long"},{"name":"documentId","required":false,"paramType":"long"}]},{"name":"definition","fields":[{"name":"exampleUsage","required":false,"wrapperName":"exampleUses","paramType":"List[ExampleUsage]"},{"name":"word","required":false,"paramType":"string"},{"name":"text","required":false,"paramType":"string"},{"name":"textPron","required":false,"wrapperName":"textProns","paramType":"List[textPron]"},{"name":"score","required":false,"paramType":"float"},{"name":"partOfSpeech","required":false,"paramType":"string"},{"name":"note","required":false,"wrapperName":"notes","paramType":"List[note]"},{"name":"citation","required":false,"wrapperName":"citations","paramType":"List[citation]"},{"name":"relWord","required":false,"wrapperName":"relatedWords","paramType":"List[related]"},{"name":"sourceDictionary","required":false,"paramType":"string"},{"name":"label","required":false,"wrapperName":"labels","paramType":"List[Label]"},{"name":"sequence","required":false,"paramType":"string"},{"name":"seqString","required":false,"paramType":"string"},{"name":"extendedText","required":false,"paramType":"string"}]},{"name":"category","fields":[{"name":"name","required":false,"paramType":"string"}]},{"name":"frequency","fields":[{"name":"year","required":false,"paramType":"int"},{"name":"count","required":false,"paramType":"long"}]},{"name":"contentProvider","fields":[{"name":"name","required":false,"paramType":"string"},{"name":"id","required":false,"paramType":"int"}]},{"name":"audioType","fields":[{"name":"name","required":false,"paramType":"string"},{"name":"id","required":false,"paramType":"int"}]},{"name":"ExampleUsage","fields":[{"name":"text","required":false,"paramType":"string"}]},{"name":"root","fields":[{"name":"name","required":false,"paramType":"string"},{"name":"categories","required":false,"paramType":"List[category]"}]},{"name":"frequencySummary","fields":[{"name":"word","required":false,"paramType":"string"},{"name":"totalCount","required":false,"paramType":"long"},{"name":"frequency","required":false,"paramType":"List[frequency]"},{"name":"unknownYearCount","required":false,"paramType":"int"}]},{"name":"audioType","fields":[{"name":"name","required":false,"paramType":"string"},{"name":"id","required":false,"paramType":"int"}]},{"name":"citation","fields":[{"name":"source","required":false,"paramType":"string"},{"name":"cite","required":false,"paramType":"string"}]},{"name":"scoredWord","fields":[{"name":"id","required":false,"paramType":"long"},{"name":"wordType","required":false,"paramType":"string"},{"name":"position","required":false,"paramType":"int"},{"name":"word","required":false,"paramType":"string"},{"name":"score","required":false,"paramType":"float"},{"name":"sentenceId","required":false,"paramType":"long"},{"name":"partOfSpeech","required":false,"paramType":"string"}]},{"name":"facetValue","fields":[{"name":"value","required":false,"paramType":"string"},{"name":"count","required":false,"paramType":"long"}]},{"name":"sentence","fields":[{"name":"id","required":false,"paramType":"long"},{"name":"scoredWord","required":false,"wrapperName":"scoredWords","paramType":"List[scoredWord]"},{"name":"display","required":false,"paramType":"string"},{"name":"documentMetadataId","required":false,"paramType":"long"},{"name":"rating","required":false,"paramType":"int"}]},{"name":"facet","fields":[{"name":"name","required":false,"paramType":"string"},{"name":"facetValue","required":false,"wrapperName":"facetValues","paramType":"List[facetValue]"}]},{"name":"wordObject","fields":[{"name":"word","required":false,"paramType":"string"},{"name":"vulgar","required":false,"paramType":"string"}]},{"name":"relationshipMap","fields":[{"name":"sourceWordstring","required":false,"paramType":"string"},{"name":"suggestion","required":false,"wrapperName":"suggestions","paramType":"List[suggestion]"}]},{"name":"bigram","fields":[{"name":"count","required":false,"paramType":"long"},{"name":"gram1","required":false,"paramType":"string"},{"name":"gram2","required":false,"paramType":"string"},{"name":"mi","required":false,"paramType":"double"},{"name":"wlmi","required":false,"paramType":"double"}]},{"name":"related","fields":[{"name":"word","required":false,"wrapperName":"words","paramType":"List[string]"},{"name":"relationshipType","required":false,"paramType":"string"},{"name":"label1","required":false,"paramType":"string"},{"name":"label2","required":false,"paramType":"string"},{"name":"label3","required":false,"paramType":"string"},{"name":"label4","required":false,"paramType":"string"},{"name":"gram","required":false,"paramType":"string"}]},{"name":"exampleSearchResults","fields":[{"name":"facet","required":false,"wrapperName":"facets","paramType":"List[facet]"},{"name":"example","required":false,"wrapperName":"examples","paramType":"List[example]"}]},{"name":"frequencySummaryE","fields":[{"name":"elements","required":false,"paramType":"List[frequencyElement]"}]},{"name":"partOfSpeech","fields":[{"name":"roots","required":false,"paramType":"List[root]"}]},{"name":"audioFile","fields":[{"name":"id","required":true,"paramType":"long"},{"name":"description","required":false,"paramType":"string"},{"name":"createdBy","required":false,"paramType":"string"},{"name":"word","required":false,"paramType":"string"},{"name":"createdAt","required":false,"paramType":"Date"},{"name":"commentCount","required":false,"paramType":"int"},{"name":"voteCount","required":false,"paramType":"integer"},{"name":"voteAverage","required":false,"paramType":"float"},{"name":"voteWeightedAverage","required":false,"paramType":"float"},{"name":"fileUrl","required":false,"paramType":"string"}]},{"name":"syllable","fields":[{"name":"type","required":false,"paramType":"string"},{"name":"seq","required":false,"paramType":"int"},{"name":"text","required":false,"paramType":"string"}]},{"name":"textPron","fields":[{"name":"id","required":false,"paramType":"long"},{"name":"seq","required":false,"paramType":"int"},{"name":"raw","required":false,"paramType":"string"},{"name":"rawType","required":false,"paramType":"string"}]},{"name":"Label","fields":[{"name":"type","required":false,"paramType":"string"},{"name":"text","required":false,"paramType":"string"}]},{"name":"DefinitionSearchResults","fields":[{"name":"result","required":false,"wrapperName":"results","paramType":"List[definition]"},{"name":"totalResults","required":false,"paramType":"int"}]},{"name":"frequencyElement","fields":[{"name":"year","required":false,"paramType":"int"},{"name":"lowerWisker","required":false,"paramType":"double"},{"name":"upperWisker","required":false,"paramType":"double"},{"name":"lowerBox","required":false,"paramType":"double"},{"name":"upperBox","required":false,"paramType":"double"}]},{"name":"audioObject","fields":[{"name":"id","required":false,"paramType":"long"},{"name":"type","required":false,"paramType":"audioType"},{"name":"description","required":false,"paramType":"string"},{"name":"userId","required":false,"paramType":"long"},{"name":"createdBy","required":false,"paramType":"string"},{"name":"wordstring","required":false,"paramType":"string"},{"name":"wordId","required":false,"paramType":"long"},{"name":"createdAt","required":false,"paramType":"Date"},{"name":"filePath","required":false,"paramType":"string"},{"name":"recordId","required":false,"paramType":"string"},{"name":"audioFileType","required":false,"paramType":"audioType"},{"name":"audioFileId","required":false,"paramType":"long"},{"name":"streamPath","required":false,"paramType":"string"}]},{"name":"suggestion","fields":[{"name":"type","required":false,"paramType":"int"},{"name":"wordstring","required":false,"paramType":"string"}]}]}
@@ -1 +1 @@
1
- {"endPoints":[{"path":"/wordList.{format}/{wordListId}","description":"","operations":[{"parameters":[{"name":"wordListId","description":"ID of WordList to fetch","required":true,"paramType":"path"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"wordList","errorResponses":[{"reason":"Invalid ID supplied","code":400},{"reason":"Not Authorized to access WordList","code":403},{"reason":"WordList not found","code":404}],"condition":"any"}],"summary":"Fetches a WordList by ID","open":false,"httpMethod":"GET"}]},{"path":"/wordList.{format}/{wordListId}/deleteWords","description":"","operations":[{"parameters":[{"name":"wordListId","description":"ID of WordList to use","required":true,"paramType":"path"},{"description":"Words to remove from WordList","required":false,"paramType":"body"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"void","errorResponses":[{"reason":"Invalid ID supplied","code":400},{"reason":"Not Authorized to modify WordList","code":403},{"reason":"WordList not found","code":404}],"condition":"any"}],"summary":"Removes words from a WordList","open":false,"httpMethod":"POST"}]},{"path":"/wordList.{format}/{wordListId}/words","description":"","operations":[{"parameters":[{"name":"wordListId","description":"ID of WordList to use","required":true,"paramType":"path"},{"name":"sortBy","description":"Field to sort by","required":false,"allowableValues":"createDate,alpha","paramType":"query"},{"name":"sortOrder","description":"Direction to sort","required":false,"allowableValues":"asc,desc","paramType":"query"},{"name":"skip","description":"Results to skip","required":false,"paramType":"query"},{"name":"limit","description":"Maximum number of results to return","required":false,"paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"List[wordListWord]","errorResponses":[{"reason":"Invalid ID supplied","code":400},{"reason":"Not Authorized to access WordList","code":403},{"reason":"WordList not found","code":404}],"condition":"any"}],"summary":"Fetches words in a WordList","open":false,"httpMethod":"GET"}]},{"path":"/wordList.{format}/{wordListId}/words","description":"","operations":[{"parameters":[{"name":"wordListId","description":"ID of WordList to user","required":true,"paramType":"path"},{"description":"Words to add to WordList","required":false,"paramType":"body"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"void","errorResponses":[{"reason":"Invalid ID supplied","code":400},{"reason":"Not Authorized to access WordList","code":403},{"reason":"WordList not found","code":404}],"condition":"any"}],"summary":"Adds words to a WordList","open":false,"httpMethod":"POST"}]},{"path":"/wordList.{format}/{wordListId}","description":"","operations":[{"parameters":[{"name":"wordListId","description":"ID of WordList to update","required":true,"paramType":"path"},{"description":"Updated WordList","required":false,"paramType":"body"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"void","errorResponses":[{"reason":"Invalid ID supplied","code":400},{"reason":"Not Authorized to update WordList","code":403},{"reason":"WordList not found","code":404}],"condition":"any"}],"summary":"Updates an existing WordList","open":false,"httpMethod":"PUT"}]},{"path":"/wordList.{format}/{wordListId}","description":"","operations":[{"parameters":[{"name":"wordListId","description":"ID of WordList to delete","required":true,"paramType":"path"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"void","errorResponses":[{"reason":"Invalid ID supplied","code":400},{"reason":"Not Authorized to delete WordList","code":403},{"reason":"WordList not found","code":404}],"condition":"any"}],"summary":"Deletes an existing WordList","open":false,"httpMethod":"DELETE"}]}],"models":[{"name":"wordList","fields":[{"name":"name","required":false,"paramType":"string"},{"name":"id","required":false,"paramType":"long"},{"name":"type","required":false,"paramType":"WordListType"},{"name":"description","required":false,"paramType":"string"},{"name":"userId","required":false,"paramType":"long"},{"name":"permalink","required":false,"paramType":"string"},{"name":"createdAt","required":false,"paramType":"Date"},{"name":"username","required":false,"paramType":"string"},{"name":"updatedAt","required":false,"paramType":"Date"},{"name":"numberWordsInList","required":false,"paramType":"long"}]},{"name":"wordListWord","fields":[{"name":"userId","required":false,"paramType":"long"},{"name":"word","required":false,"paramType":"string"},{"name":"createdAt","required":false,"paramType":"Date"},{"name":"username","required":false,"paramType":"string"},{"name":"numberCommentsOnWord","required":false,"paramType":"long"},{"name":"numberLists","required":false,"paramType":"long"}]}]}
1
+ {"endPoints":[{"path":"/wordList.{format}/{wordListId}","description":"","operations":[{"parameters":[{"name":"wordListId","description":"ID of WordList to fetch","required":true,"dataType":"string","paramType":"path"},{"name":"auth_token","description":"The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above)","required":true,"dataType":"string","paramType":"header"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"wordList","errorResponses":[{"reason":"Invalid ID supplied","code":400},{"reason":"Not Authorized to access WordList","code":403},{"reason":"WordList not found","code":404}],"condition":"any"}],"category":"WordListInfo","summary":"Fetches a WordList by ID","suggestedName":"getWordListById","deprecated":false,"open":false,"httpMethod":"GET"}]},{"path":"/wordList.{format}/{wordListId}/words","description":"","operations":[{"parameters":[{"name":"wordListId","description":"ID of WordList to use","required":true,"dataType":"string","paramType":"path"},{"name":"sortBy","description":"Field to sort by","required":false,"dataType":"string","allowableValues":"createDate,alpha","paramType":"query"},{"name":"sortOrder","description":"Direction to sort","required":false,"dataType":"string","allowableValues":"asc,desc","paramType":"query"},{"name":"skip","description":"Results to skip","required":false,"dataType":"string","paramType":"query"},{"name":"limit","description":"Maximum number of results to return","required":false,"dataType":"string","paramType":"query"},{"name":"auth_token","description":"The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above)","required":true,"dataType":"string","paramType":"header"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"List[wordListWord]","errorResponses":[{"reason":"Invalid ID supplied","code":400},{"reason":"Not Authorized to access WordList","code":403},{"reason":"WordList not found","code":404}],"condition":"any"}],"category":"WordListInfo","summary":"Fetches words in a WordList","suggestedName":"getWordListWords","deprecated":false,"open":false,"httpMethod":"GET"}]},{"path":"/wordList.{format}/{wordListId}/words","description":"","operations":[{"parameters":[{"name":"wordListId","description":"ID of WordList to user","required":true,"dataType":"string","paramType":"path"},{"description":"Words to add to WordList","required":false,"dataType":"StringValue[]","paramType":"body"},{"name":"auth_token","description":"The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above)","required":true,"dataType":"string","paramType":"header"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"void","errorResponses":[{"reason":"Invalid ID supplied","code":400},{"reason":"Not Authorized to access WordList","code":403},{"reason":"WordList not found","code":404}],"condition":"any"}],"category":"WordListInfo","summary":"Adds words to a WordList","suggestedName":"addWordsToWordList","deprecated":false,"open":false,"httpMethod":"POST"}]},{"path":"/wordList.{format}/{wordListId}","description":"","operations":[{"parameters":[{"name":"wordListId","description":"ID of WordList to update","required":true,"dataType":"string","paramType":"path"},{"description":"Updated WordList","required":false,"dataType":"wordList","paramType":"body"},{"name":"auth_token","description":"The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above)","required":true,"dataType":"string","paramType":"header"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"void","errorResponses":[{"reason":"Invalid ID supplied","code":400},{"reason":"Not Authorized to update WordList","code":403},{"reason":"WordList not found","code":404}],"condition":"any"}],"category":"WordListInfo","summary":"Updates an existing WordList","suggestedName":"updateWordList","deprecated":false,"open":false,"httpMethod":"PUT"}]},{"path":"/wordList.{format}/{wordListId}","description":"","operations":[{"parameters":[{"name":"wordListId","description":"ID of WordList to delete","required":true,"dataType":"string","paramType":"path"},{"name":"auth_token","description":"The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above)","required":true,"dataType":"string","paramType":"header"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"void","errorResponses":[{"reason":"Invalid ID supplied","code":400},{"reason":"Not Authorized to delete WordList","code":403},{"reason":"WordList not found","code":404}],"condition":"any"}],"category":"WordListInfo","summary":"Deletes an existing WordList","suggestedName":"deleteWordList","deprecated":false,"open":false,"httpMethod":"DELETE"}]},{"path":"/wordList.{format}/{wordListId}/deleteWords","description":"","operations":[{"parameters":[{"name":"wordListId","description":"ID of WordList to use","required":true,"dataType":"string","paramType":"path"},{"description":"Words to remove from WordList","required":false,"dataType":"StringValue[]","paramType":"body"},{"name":"auth_token","description":"The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above)","required":true,"dataType":"string","paramType":"header"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"void","errorResponses":[{"reason":"Invalid ID supplied","code":400},{"reason":"Not Authorized to modify WordList","code":403},{"reason":"WordList not found","code":404}],"condition":"any"}],"category":"WordListInfo","summary":"Removes words from a WordList","suggestedName":"deleteWordsFromWordList","deprecated":false,"open":false,"httpMethod":"POST"}]}],"models":[{"name":"wordList","fields":[{"name":"name","required":false,"paramType":"string"},{"name":"id","required":false,"paramType":"long"},{"name":"type","required":false,"paramType":"string"},{"name":"description","required":false,"paramType":"string"},{"name":"userId","required":false,"paramType":"long"},{"name":"permalink","required":false,"paramType":"string"},{"name":"createdAt","required":false,"paramType":"Date"},{"name":"username","required":false,"paramType":"string"},{"name":"updatedAt","required":false,"paramType":"Date"},{"name":"numberWordsInList","required":false,"paramType":"long"}]},{"name":"wordListWord","fields":[{"name":"userId","required":false,"paramType":"long"},{"name":"word","required":false,"paramType":"string"},{"name":"createdAt","required":false,"paramType":"Date"},{"name":"username","required":false,"paramType":"string"},{"name":"numberCommentsOnWord","required":false,"paramType":"long"},{"name":"numberLists","required":false,"paramType":"long"}]}]}
@@ -1 +1 @@
1
- {"endPoints":[{"path":"/wordLists","description":"","operations":[{"parameters":[{"description":"WordList to create","required":false,"paramType":"body"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"wordList","errorResponses":[{"reason":"Invalid WordList supplied or mandatory fields are missing.","code":400},{"reason":"Not authenticated.","code":403},{"reason":"WordList owner not found.","code":404}],"condition":"any"}],"summary":"Creates a WordList.","open":false,"httpMethod":"POST"}]},{"path":"/wordLists","description":"","operations":[{"parameters":[{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"doc","errorResponses":[{"reason":"No data available","code":404}],"condition":"any"}],"summary":"Returns information about API parameters","open":true,"httpMethod":"GET"}]}],"models":[{"name":"error","fields":[{"name":"reason","required":false,"paramType":"string"},{"name":"code","required":false,"paramType":"int"}]},{"name":"response","fields":[{"name":"valueType","required":false,"paramType":"string"},{"name":"errorResponses","required":false,"paramType":"List[error]"},{"name":"occurs","required":false,"paramType":"string"},{"name":"condition","required":false,"paramType":"string"}]},{"name":"parameter","fields":[{"name":"name","required":false,"paramType":"string"},{"name":"defaultValue","required":false,"paramType":"string"},{"name":"description","required":false,"paramType":"string"},{"name":"required","required":false,"paramType":"boolean"},{"name":"allowableValues","required":false,"paramType":"string"},{"name":"wrapperName","required":false,"paramType":"string"},{"name":"internalDescription","required":false,"paramType":"string"},{"name":"paramAccess","required":false,"paramType":"string"},{"name":"paramType","required":false,"paramType":"string"}]},{"name":"wordList","fields":[{"name":"name","required":false,"paramType":"string"},{"name":"id","required":false,"paramType":"long"},{"name":"type","required":false,"paramType":"WordListType"},{"name":"description","required":false,"paramType":"string"},{"name":"userId","required":false,"paramType":"long"},{"name":"permalink","required":false,"paramType":"string"},{"name":"createdAt","required":false,"paramType":"Date"},{"name":"username","required":false,"paramType":"string"},{"name":"updatedAt","required":false,"paramType":"Date"},{"name":"numberWordsInList","required":false,"paramType":"long"}]},{"name":"doc","fields":[{"name":"endPoints","required":false,"paramType":"List[endpoint]"},{"name":"models","required":false,"paramType":"List[object]"}]},{"name":"object","fields":[{"name":"name","required":false,"paramType":"string"},{"name":"fields","required":false,"paramType":"List[parameter]"},{"name":"uniqueFieldName","required":false,"paramType":"string"}]},{"name":"endpoint","fields":[{"name":"path","required":false,"paramType":"string"},{"name":"description","required":false,"paramType":"string"},{"name":"operations","required":false,"paramType":"List[operation]"}]},{"name":"operation","fields":[{"name":"parameters","required":false,"paramType":"List[parameter]"},{"name":"response","required":false,"paramType":"List[response]"},{"name":"summary","required":false,"paramType":"string"},{"name":"open","required":false,"paramType":"boolean"},{"name":"notes","required":false,"paramType":"string"},{"name":"httpMethod","required":false,"paramType":"string"}]}]}
1
+ {"endPoints":[{"path":"/wordLists.{format}","description":"","operations":[{"parameters":[{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"doc","errorResponses":[{"reason":"No data available","code":404}],"condition":"any"}],"category":"Help","summary":"Returns information about API parameters","suggestedName":"getHelp","deprecated":false,"open":true,"httpMethod":"GET"}]},{"path":"/wordLists.{format}","description":"","operations":[{"parameters":[{"description":"WordList to create","required":false,"dataType":"wordList","paramType":"body"},{"name":"auth_token","description":"The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above)","required":true,"dataType":"string","paramType":"header"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"wordList","errorResponses":[{"reason":"Invalid WordList supplied or mandatory fields are missing.","code":400},{"reason":"Not authenticated.","code":403},{"reason":"WordList owner not found.","code":404}],"condition":"any"}],"category":"WordLists","summary":"Creates a WordList.","suggestedName":"createWordList","deprecated":false,"open":false,"httpMethod":"POST"}]}],"models":[{"name":"error","fields":[{"name":"reason","required":false,"paramType":"string"},{"name":"code","required":false,"paramType":"int"}]},{"name":"response","fields":[{"name":"valueType","required":false,"paramType":"string"},{"name":"errorResponses","required":false,"paramType":"List[error]"},{"name":"occurs","required":false,"paramType":"string"},{"name":"condition","required":false,"paramType":"string"}]},{"name":"parameter","fields":[{"name":"name","required":false,"paramType":"string"},{"name":"defaultValue","required":false,"paramType":"string"},{"name":"description","required":false,"paramType":"string"},{"name":"required","required":false,"paramType":"boolean"},{"name":"dataType","required":false,"paramType":"string"},{"name":"allowableValues","required":false,"paramType":"string"},{"name":"wrapperName","required":false,"paramType":"string"},{"name":"internalDescription","required":false,"paramType":"string"},{"name":"paramAccess","required":false,"paramType":"string"},{"name":"paramType","required":false,"paramType":"string"}]},{"name":"wordList","fields":[{"name":"name","required":false,"paramType":"string"},{"name":"id","required":false,"paramType":"long"},{"name":"type","required":false,"paramType":"string"},{"name":"description","required":false,"paramType":"string"},{"name":"userId","required":false,"paramType":"long"},{"name":"permalink","required":false,"paramType":"string"},{"name":"createdAt","required":false,"paramType":"Date"},{"name":"username","required":false,"paramType":"string"},{"name":"updatedAt","required":false,"paramType":"Date"},{"name":"numberWordsInList","required":false,"paramType":"long"}]},{"name":"doc","fields":[{"name":"endPoints","required":false,"paramType":"List[endpoint]"},{"name":"models","required":false,"paramType":"List[object]"}]},{"name":"object","fields":[{"name":"name","required":false,"paramType":"string"},{"name":"fields","required":false,"paramType":"List[parameter]"},{"name":"uniqueFieldName","required":false,"paramType":"string"}]},{"name":"endpoint","fields":[{"name":"path","required":false,"paramType":"string"},{"name":"description","required":false,"paramType":"string"},{"name":"operations","required":false,"paramType":"List[operation]"}]},{"name":"operation","fields":[{"name":"parameters","required":false,"paramType":"List[parameter]"},{"name":"response","required":false,"paramType":"List[response]"},{"name":"category","required":false,"paramType":"string"},{"name":"summary","required":false,"paramType":"string"},{"name":"suggestedName","required":false,"paramType":"string"},{"name":"deprecated","required":false,"paramType":"boolean"},{"name":"open","required":false,"paramType":"boolean"},{"name":"notes","required":false,"paramType":"string"},{"name":"httpMethod","required":false,"paramType":"string"}]}]}
data/api_docs/words.json CHANGED
@@ -1 +1 @@
1
- {"endPoints":[{"path":"/words.{format}/randomWord","description":"","operations":[{"parameters":[{"name":"hasDictionaryDef","defaultValue":"true","description":"Only return words with dictionary definitions","required":false,"paramType":"query"},{"name":"includePartOfSpeech","description":"CSV part-of-speech values to include","required":false,"paramType":"query"},{"name":"excludePartOfSpeech","description":"CSV part-of-speech values to exclude","required":false,"paramType":"query"},{"name":"minCorpusCount","description":"Minimum corpus frequency for terms","required":false,"paramType":"query"},{"name":"maxCorpusCount","description":"Maximum corpus frequency for terms","required":false,"paramType":"query"},{"name":"minDictionaryCount","description":"Minimum dictionary count","required":false,"paramType":"query"},{"name":"maxDictionaryCount","description":"Maximum dictionary count","required":false,"paramType":"query"},{"name":"minLength","description":"Minimum word length","required":false,"paramType":"query"},{"name":"maxLength","description":"Maximum word length","required":false,"paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"wordObject","errorResponses":[{"reason":"No word found.","code":404}],"condition":"any"}],"summary":"Returns a single random WordObject, in the format specified by the URL","open":false,"httpMethod":"GET"}]},{"path":"/words.{format}/randomWords","description":"","operations":[{"parameters":[{"name":"hasDictionaryDef","description":"Only return words with dictionary definitions","required":false,"paramType":"query"},{"name":"includePartOfSpeech","description":"CSV part-of-speech values to include","required":false,"paramType":"query"},{"name":"excludePartOfSpeech","description":"CSV part-of-speech values to exclude","required":false,"paramType":"query"},{"name":"minCorpusCount","description":"Minimum corpus frequency for terms (integer)","required":false,"paramType":"query"},{"name":"maxCorpusCount","description":"Maximum corpus frequency for terms (integer)","required":false,"paramType":"query"},{"name":"minDictionaryCount","description":"Minimum dictionary count (integer)","required":false,"paramType":"query"},{"name":"maxDictionaryCount","description":"Maximum dictionary count (integer)","required":false,"paramType":"query"},{"name":"minLength","description":"Minimum word length (characters)","required":false,"paramType":"query"},{"name":"maxLength","description":"Maximum word length (characters)","required":false,"paramType":"query"},{"name":"sortBy","description":"Attribute to sort by","required":false,"allowableValues":"alpha,count","paramType":"query"},{"name":"sortOrder","description":"Sort direction","required":false,"allowableValues":"asc,desc","paramType":"query"},{"name":"limit","description":"Maximum number of results to return (integer)","required":false,"paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"List[wordObject]","errorResponses":[{"reason":"Invalid term supplied.","code":400},{"reason":"No results.","code":404}],"condition":"any"}],"summary":"Returns an array of random WordObjects, in the format specified by the URL","open":false,"httpMethod":"GET"}]},{"path":"/words.{format}/search","description":"","operations":[{"parameters":[{"name":"query","description":"Search term","required":true,"paramType":"query"},{"name":"caseSensitive","defaultValue":"true","description":"Search case sensitive","required":false,"allowableValues":"true | false","paramType":"query"},{"name":"includePartOfSpeech","description":"Only include these comma-delimited parts of speech","required":false,"paramType":"query"},{"name":"excludePartOfSpeech","description":"Exclude these comma-delimited parts of speech","required":false,"paramType":"query"},{"name":"minCorpusCount","defaultValue":"5","description":"Minimum corpus frequency for terms","required":false,"allowableValues":"non-negative integer","paramType":"query"},{"name":"maxCorpusCount","description":"Maximum corpus frequency for terms","required":false,"allowableValues":"non-negative integer","paramType":"query"},{"name":"minDictionaryCount","defaultValue":"1","description":"Minimum number of dictionary entries","required":false,"allowableValues":"non-negative integer","paramType":"query"},{"name":"maxDictionaryCount","description":"Maximum dictionary count","required":false,"allowableValues":"non-negative integer","paramType":"query"},{"name":"minLength","defaultValue":"1","description":"Minimum word length","required":false,"allowableValues":"0 to 1024","paramType":"query"},{"name":"maxLength","description":"Maximum word length","required":false,"allowableValues":"0 to 1024","paramType":"query"},{"name":"skip","defaultValue":"0","description":"Results to skip","required":false,"allowableValues":"0 to 1000","paramType":"query"},{"name":"limit","defaultValue":"10","description":"Maximum number of results to return","required":false,"allowableValues":"1 to 1000","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"List[wordFrequency]","errorResponses":[{"reason":"Invalid term supplied.","code":400},{"reason":"No results.","code":404}],"condition":"any"}],"summary":"Searches words.","open":false,"httpMethod":"GET"}]},{"path":"/words.{format}/wordOfTheDay","description":"","operations":[{"parameters":[{"name":"date","description":"Fetches by date in yyyy-MM-dd","required":false,"paramType":"query"},{"name":"category","description":"Filters response by category","required":false,"paramType":"query"},{"name":"creator","description":"Filters response by username","required":false,"paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"WordOfTheDay","errorResponses":[{"reason":"No data available","code":404}],"condition":"any"}],"summary":"Returns a specific WordOfTheDay","open":true,"httpMethod":"GET"}]},{"path":"/words.{format}/search/{query}","description":"","operations":[{"parameters":[{"name":"query","description":"Search query","required":true,"paramType":"path"},{"name":"caseSensitive","defaultValue":"true","description":"Search case sensitive","required":false,"allowableValues":"true | false","paramType":"query"},{"name":"includePartOfSpeech","description":"Only include these comma-delimited parts of speech","required":false,"paramType":"query"},{"name":"excludePartOfSpeech","description":"Exclude these comma-delimited parts of speech","required":false,"paramType":"query"},{"name":"minCorpusCount","defaultValue":"5","description":"Minimum corpus frequency for terms","required":false,"allowableValues":"non-negative integer","paramType":"query"},{"name":"maxCorpusCount","description":"Maximum corpus frequency for terms","required":false,"allowableValues":"non-negative integer","paramType":"query"},{"name":"minDictionaryCount","defaultValue":"1","description":"Minimum number of dictionary entries","required":false,"allowableValues":"non-negative integer","paramType":"query"},{"name":"maxDictionaryCount","description":"Maximum dictionary count","required":false,"allowableValues":"non-negative integer","paramType":"query"},{"name":"minLength","defaultValue":"1","description":"Minimum word length","required":false,"allowableValues":"0 to 1024","paramType":"query"},{"name":"maxLength","description":"Maximum word length","required":false,"allowableValues":"0 to 1024","paramType":"query"},{"name":"skip","defaultValue":"0","description":"Results to skip","required":false,"allowableValues":"0 to 1000","paramType":"query"},{"name":"limit","defaultValue":"10","description":"Maximum number of results to return","required":false,"allowableValues":"1 to 1000","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"wordSearchResults","errorResponses":[{"reason":"Invalid query supplied.","code":400}],"condition":"any"}],"summary":"Searches words.","open":false,"httpMethod":"GET"}]}],"models":[{"name":"wordFrequency","fields":[{"name":"count","required":false,"paramType":"long"},{"name":"wordstring","required":false,"paramType":"string"}]},{"name":"partOfSpeech","fields":[{"name":"roots","required":false,"paramType":"List[root]"}]},{"name":"wordObject","fields":[{"name":"word","required":false,"paramType":"string"},{"name":"vulgar","required":false,"paramType":"string"}]},{"name":"wordSearchResults","fields":[{"name":"searchResult","required":false,"wrapperName":"searchResults","paramType":"List[WordSearchResult]"},{"name":"totalResults","required":false,"paramType":"int"}]},{"name":"contentProvider","fields":[{"name":"name","required":false,"paramType":"string"},{"name":"id","required":false,"paramType":"int"}]},{"name":"WordOfTheDay","fields":[{"name":"id","required":true,"paramType":"long"},{"name":"category","required":false,"paramType":"string"},{"name":"example","required":false,"wrapperName":"examples","paramType":"List[SimpleExample]"},{"name":"createdBy","required":false,"paramType":"string"},{"name":"word","required":false,"paramType":"string"},{"name":"definition","required":false,"wrapperName":"definitions","paramType":"List[SimpleDefinition]"},{"name":"contentProvider","required":false,"paramType":"contentProvider"},{"name":"createdAt","required":false,"paramType":"Date"},{"name":"publishDate","required":false,"paramType":"Date"},{"name":"parentId","required":false,"paramType":"string"},{"name":"note","required":false,"paramType":"string"},{"name":"htmlExtra","required":false,"paramType":"string"}]},{"name":"SimpleDefinition","fields":[{"name":"text","required":false,"paramType":"string"},{"name":"partOfSpeech","required":false,"paramType":"string"},{"name":"note","required":false,"paramType":"string"},{"name":"source","required":false,"paramType":"string"}]},{"name":"WordSearchResult","fields":[{"name":"count","required":false,"paramType":"long"},{"name":"word","required":false,"paramType":"string"},{"name":"lexicality","required":false,"paramType":"double"}]},{"name":"SimpleExample","fields":[{"name":"url","required":false,"paramType":"string"},{"name":"text","required":false,"paramType":"string"},{"name":"title","required":false,"paramType":"string"},{"name":"id","required":false,"paramType":"long"}]}]}
1
+ {"endPoints":[{"path":"/words.{format}/randomWord","description":"","operations":[{"parameters":[{"name":"hasDictionaryDef","defaultValue":"true","description":"Only return words with dictionary definitions","required":false,"dataType":"string","paramType":"query"},{"name":"includePartOfSpeech","description":"CSV part-of-speech values to include","required":false,"dataType":"string","paramType":"query"},{"name":"excludePartOfSpeech","description":"CSV part-of-speech values to exclude","required":false,"dataType":"string","paramType":"query"},{"name":"minCorpusCount","description":"Minimum corpus frequency for terms","required":false,"dataType":"string","paramType":"query"},{"name":"maxCorpusCount","description":"Maximum corpus frequency for terms","required":false,"dataType":"string","paramType":"query"},{"name":"minDictionaryCount","description":"Minimum dictionary count","required":false,"dataType":"string","paramType":"query"},{"name":"maxDictionaryCount","description":"Maximum dictionary count","required":false,"dataType":"string","paramType":"query"},{"name":"minLength","description":"Minimum word length","required":false,"dataType":"string","paramType":"query"},{"name":"maxLength","description":"Maximum word length","required":false,"dataType":"string","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"wordObject","errorResponses":[{"reason":"No word found.","code":404}],"condition":"any"}],"category":"WordDetails","summary":"Returns a single random WordObject, in the format specified by the URL","suggestedName":"getRandomWord","deprecated":false,"open":false,"httpMethod":"GET"}]},{"path":"/words.{format}/randomWords","description":"","operations":[{"parameters":[{"name":"hasDictionaryDef","description":"Only return words with dictionary definitions","required":false,"dataType":"string","paramType":"query"},{"name":"includePartOfSpeech","description":"CSV part-of-speech values to include","required":false,"dataType":"string","paramType":"query"},{"name":"excludePartOfSpeech","description":"CSV part-of-speech values to exclude","required":false,"dataType":"string","paramType":"query"},{"name":"minCorpusCount","description":"Minimum corpus frequency for terms (integer)","required":false,"dataType":"string","paramType":"query"},{"name":"maxCorpusCount","description":"Maximum corpus frequency for terms (integer)","required":false,"dataType":"string","paramType":"query"},{"name":"minDictionaryCount","description":"Minimum dictionary count (integer)","required":false,"dataType":"string","paramType":"query"},{"name":"maxDictionaryCount","description":"Maximum dictionary count (integer)","required":false,"dataType":"string","paramType":"query"},{"name":"minLength","description":"Minimum word length (characters)","required":false,"dataType":"string","paramType":"query"},{"name":"maxLength","description":"Maximum word length (characters)","required":false,"dataType":"string","paramType":"query"},{"name":"sortBy","description":"Attribute to sort by","required":false,"dataType":"string","allowableValues":"alpha,count","paramType":"query"},{"name":"sortOrder","description":"Sort direction","required":false,"dataType":"string","allowableValues":"asc,desc","paramType":"query"},{"name":"limit","description":"Maximum number of results to return (integer)","required":false,"dataType":"string","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"List[wordObject]","errorResponses":[{"reason":"Invalid term supplied.","code":400},{"reason":"No results.","code":404}],"condition":"any"}],"category":"WordDetails","summary":"Returns an array of random WordObjects, in the format specified by the URL","suggestedName":"getRandomWords","deprecated":false,"open":false,"httpMethod":"GET"}]},{"path":"/words.{format}/search","description":"","operations":[{"parameters":[{"name":"query","description":"Search term","required":true,"dataType":"string","paramType":"query"},{"name":"caseSensitive","defaultValue":"true","description":"Search case sensitive","required":false,"dataType":"string","allowableValues":"true | false","paramType":"query"},{"name":"includePartOfSpeech","description":"Only include these comma-delimited parts of speech","required":false,"dataType":"string","paramType":"query"},{"name":"excludePartOfSpeech","description":"Exclude these comma-delimited parts of speech","required":false,"dataType":"string","paramType":"query"},{"name":"minCorpusCount","defaultValue":"5","description":"Minimum corpus frequency for terms","required":false,"dataType":"string","allowableValues":"non-negative integer","paramType":"query"},{"name":"maxCorpusCount","description":"Maximum corpus frequency for terms","required":false,"dataType":"string","allowableValues":"non-negative integer","paramType":"query"},{"name":"minDictionaryCount","defaultValue":"1","description":"Minimum number of dictionary entries","required":false,"dataType":"string","allowableValues":"non-negative integer","paramType":"query"},{"name":"maxDictionaryCount","description":"Maximum dictionary count","required":false,"dataType":"string","allowableValues":"non-negative integer","paramType":"query"},{"name":"minLength","defaultValue":"1","description":"Minimum word length","required":false,"dataType":"string","allowableValues":"0 to 1024","paramType":"query"},{"name":"maxLength","description":"Maximum word length","required":false,"dataType":"string","allowableValues":"0 to 1024","paramType":"query"},{"name":"skip","defaultValue":"0","description":"Results to skip","required":false,"dataType":"string","allowableValues":"0 to 1000","paramType":"query"},{"name":"limit","defaultValue":"10","description":"Maximum number of results to return","required":false,"dataType":"string","allowableValues":"1 to 1000","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"List[wordFrequency]","errorResponses":[{"reason":"Invalid term supplied.","code":400},{"reason":"No results.","code":404}],"condition":"any"}],"category":"WordDetails","summary":"Searches words.","suggestedName":"searchWords","deprecated":false,"open":false,"httpMethod":"GET"}]},{"path":"/words.{format}/wordOfTheDayLists","description":"","operations":[{"parameters":[{"name":"containsWord","description":"Lists must contain a specific word","required":false,"dataType":"string","paramType":"query"},{"name":"subscriberCount","description":"Lists must have the specified number of subscribers","required":false,"dataType":"string","paramType":"query"},{"name":"itemCount","description":"Lists must have the specified number of items","required":true,"dataType":"string","paramType":"query"},{"name":"includeAll","description":"Returns future WordOfTheDay items","required":false,"dataType":"string","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"List[wordOfTheDayList]","errorResponses":[{"reason":"Invalid word supplied.","code":400}],"condition":"any"}],"category":"WordOfTheDayList","summary":"Fetches an array of WordOfTheDayList basd on a criteria","suggestedName":"getWordOfTheDayListsContainingWord","deprecated":false,"open":false,"httpMethod":"GET"}]},{"path":"/words.{format}/wordOfTheDayLists/{date}","description":"","operations":[{"parameters":[{"name":"date","description":"ID of WordOfTheDayList","required":false,"dataType":"string","paramType":"path"},{"name":"includeAll","description":"Returns future WordOfTheDay items","required":false,"dataType":"string","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"List[WordOfTheDay]","errorResponses":[{"reason":"Invalid ID supplied","code":400},{"reason":"WordOfTheDayList or User not found","code":404}],"condition":"any"}],"category":"WordOfTheDayList","summary":"Fetches WordOfTheDay objects for a specific date","suggestedName":"getWordOfTheDayListsForDate","deprecated":false,"open":false,"httpMethod":"GET"}]},{"path":"/words.{format}/wordOfTheDayList/{permalink}/subscription","description":"","operations":[{"parameters":[{"name":"auth_token","description":"auth_token of logged-in user","required":true,"dataType":"string","paramType":"header"},{"name":"permalink","description":"ID of WordOfTheDayList","required":false,"dataType":"string","paramType":"path"},{"name":"medium","description":"Medium to subscribe with","required":false,"dataType":"string","paramType":"query"},{"description":"Username to subscribe","required":false,"dataType":"string","paramType":"body"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"void","errorResponses":[{"reason":"Invalid ID supplied","code":400},{"reason":"Not authorized to subscribe","code":403},{"reason":"WordOfTheDayList or User not found","code":404}],"condition":"any"}],"category":"WordOfTheDayList","summary":"Subscribes a user to a WordOfTheDayList","suggestedName":"subscribeToList","deprecated":false,"open":false,"httpMethod":"POST"}]},{"path":"/words.{format}/searchDefinitions","description":"","operations":[{"parameters":[{"name":"query","description":"Search term","required":true,"dataType":"string","paramType":"query"},{"name":"definedWordSearchTerm","description":"Defined word search term","required":false,"dataType":"string","paramType":"query"},{"name":"includeSourceDictionaries","description":"Only include these comma-delimited source dictionaries","required":false,"dataType":"string","allowableValues":"ahd, century, wiktionary, webster, wordnet","paramType":"query"},{"name":"excludeSourceDictionaries","description":"Exclude these comma-delimited source dictionaries","required":false,"dataType":"string","allowableValues":"ahd, century, wiktionary, webster, wordnet","paramType":"query"},{"name":"includePartOfSpeech","description":"Only include these comma-delimited parts of speech","required":false,"dataType":"string","paramType":"query"},{"name":"excludePartOfSpeech","description":"Exclude these comma-delimited parts of speech","required":false,"dataType":"string","paramType":"query"},{"name":"minCorpusCount","defaultValue":"5","description":"Minimum corpus frequency for terms","required":false,"dataType":"string","allowableValues":"non-negative integer","paramType":"query"},{"name":"maxCorpusCount","description":"Maximum corpus frequency for terms","required":false,"dataType":"string","allowableValues":"non-negative integer","paramType":"query"},{"name":"minLength","defaultValue":"1","description":"Minimum word length","required":false,"dataType":"string","allowableValues":"0 to 1024","paramType":"query"},{"name":"maxLength","description":"Maximum word length","required":false,"dataType":"string","allowableValues":"0 to 1024","paramType":"query"},{"name":"expandTerms","description":"Expand terms","required":false,"dataType":"string","allowableValues":"synonym,hypernym","paramType":"query"},{"name":"wordTypes","description":"Word types","required":false,"dataType":"string","allowableValues":"word,multi-word-unit","paramType":"query"},{"name":"includeTags","defaultValue":"false","description":"Return a closed set of XML tags in response","required":false,"dataType":"string","allowableValues":"false,true","paramType":"query"},{"name":"sortBy","description":"Attribute to sort by","required":false,"dataType":"string","allowableValues":"alpha,count,length","paramType":"query"},{"name":"sortOrder","description":"Sort direction","required":false,"dataType":"string","allowableValues":"asc,desc","paramType":"query"},{"name":"skip","defaultValue":"0","description":"Results to skip","required":false,"dataType":"string","allowableValues":"0 to 1000","paramType":"query"},{"name":"limit","defaultValue":"10","description":"Maximum number of results to return","required":false,"dataType":"string","allowableValues":"1 to 1000","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"DefinitionSearchResults","errorResponses":[{"reason":"Invalid term supplied.","code":400}],"condition":"any"}],"category":"WordDetails","summary":"Searches definitions.","suggestedName":"searchDefinitions","deprecated":false,"open":false,"httpMethod":"GET"}]},{"path":"/words.{format}/searchEntries","description":"","operations":[{"parameters":[{"name":"query","description":"Search term","required":true,"dataType":"string","paramType":"query"},{"name":"skip","defaultValue":"0","description":"Results to skip","required":false,"dataType":"string","allowableValues":"0 to 1000","paramType":"query"},{"name":"limit","defaultValue":"10","description":"Maximum number of results to return","required":false,"dataType":"string","allowableValues":"1 to 1000","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"EntrySearchResults","errorResponses":[{"reason":"Invalid term supplied.","code":400}],"condition":"any"}],"category":"WordDetails","summary":"Searches dictionary entries.","suggestedName":"searchEntries","deprecated":false,"open":false,"httpMethod":"GET"}]},{"path":"/words.{format}/surfaceForms","description":"","operations":[{"parameters":[{"name":"term","description":"Word to get surface forms for.","required":false,"dataType":"string","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"String","errorResponses":[{"reason":"Invalid term supplied.","code":400}],"condition":"any"}],"category":"WordDetails","summary":"Fetches surface forms of a word","suggestedName":"getSurfaceForms","deprecated":false,"open":false,"httpMethod":"GET"}]},{"path":"/words.{format}/wordOfTheDay","description":"","operations":[{"parameters":[{"name":"date","description":"Fetches by date in yyyy-MM-dd","required":false,"dataType":"string","paramType":"query"},{"name":"category","description":"Filters response by category","required":false,"dataType":"string","paramType":"query"},{"name":"creator","description":"Filters response by username","required":false,"dataType":"string","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"WordOfTheDay","errorResponses":[{"reason":"No data available","code":404}],"condition":"any"}],"category":"WordOfTheDay","summary":"Returns a specific WordOfTheDay","suggestedName":"getWordOfTheDay","deprecated":false,"open":false,"httpMethod":"GET"}]},{"path":"/words.{format}/wordOfTheDay/range","description":"","operations":[{"parameters":[{"name":"category","description":"Filters response by category","required":false,"dataType":"string","paramType":"query"},{"name":"creator","description":"Filters response by username","required":false,"dataType":"string","paramType":"query"},{"name":"provider","description":"Filters response by ContentProvider","required":false,"dataType":"string","paramType":"query"},{"name":"skip","description":"Results to skip","required":false,"dataType":"string","paramType":"query"},{"name":"limit","description":"Maximum number of results to return","required":false,"dataType":"string","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"List[WordOfTheDay]","errorResponses":[{"reason":"No data available","code":404}],"condition":"any"}],"category":"WordOfTheDay","summary":"Returns a WordOfTheDay range","suggestedName":"getWordOfTheDayRange","deprecated":false,"open":false,"httpMethod":"GET"}]},{"path":"/words.{format}/wordOfTheDayList/{permalink}","description":"","operations":[{"parameters":[{"name":"permalink","description":"ID of WordOfTheDayList","required":false,"dataType":"string","paramType":"path"},{"name":"includeAll","description":"Returns future WordOfTheDay items","required":false,"dataType":"string","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"wordOfTheDayList","errorResponses":[{"reason":"Invalid id supplied","code":400},{"reason":"WordOfTheDayList not found","code":404}],"condition":"any"}],"category":"WordOfTheDayList","summary":"Fetches a WordOfTheDayList by ID","suggestedName":"getWordOfTheDayList","deprecated":false,"open":false,"httpMethod":"GET"}]},{"path":"/words.{format}/wordOfTheDayList/{permalink}/{specifier}","description":"","operations":[{"parameters":[{"name":"permalink","description":"ID of WordOfTheDayList","required":false,"dataType":"string","paramType":"path"},{"name":"specifier","description":"Specifier for the item to fetch. Either 'current' or a date.","required":false,"dataType":"string","paramType":"path"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"WordOfTheDay","errorResponses":[{"reason":"Invalid id supplied","code":400},{"reason":"WordOfTheDayList not found","code":404}],"condition":"any"}],"category":"WordOfTheDayList","summary":"Fetches a WordOfTheDayList by ID","suggestedName":"getWordOfTheDayListItem","deprecated":false,"open":false,"httpMethod":"GET"}]},{"path":"/words.{format}/wordOfTheDayLists/recent","description":"","operations":[{"parameters":[{"name":"skip","description":"Results to skip","required":false,"dataType":"string","paramType":"query"},{"name":"limit","description":"Maximum number of results to return","required":false,"dataType":"string","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"List[wordOfTheDayList]","errorResponses":[{"reason":"No WordOfTheDayLists found.","code":404}],"condition":"any"}],"category":"WordOfTheDayList","summary":"Fetches recently created WordOfTheDayLists","suggestedName":"getRecentWordOfTheDayLists","deprecated":false,"open":false,"httpMethod":"GET"}]},{"path":"/words.{format}/wordOfTheDayLists/subscriptionProcess","description":"","operations":[{"parameters":[{"name":"date","description":"Date string to fetch for.","required":false,"dataType":"string","paramType":"query"},{"name":"format","defaultValue":"json","description":"API response format","required":true,"allowableValues":"json,xml","paramType":"path"}],"response":[{"valueType":"String","errorResponses":[{"reason":"Invalid date format supplied.","code":400}],"condition":"any"}],"category":"WordOfTheDayList","summary":"Returns whether or not a subscription process has been run.","suggestedName":"getWordOfTheDayListSubscriptionProcessStatus","deprecated":false,"open":false,"notes":"Uses the current server time (day resolution) as the default date to check for, optionally a dateString can be supplied for a specific date to check for.","httpMethod":"GET"}]}],"models":[{"name":"wordFrequency","fields":[{"name":"count","required":false,"paramType":"long"},{"name":"wordstring","required":false,"paramType":"string"}]},{"name":"EntrySearchResult","fields":[{"name":"definition","required":false,"wrapperName":"definitions","paramType":"List[definition]"},{"name":"sourceDictionary","required":false,"paramType":"string"},{"name":"headWord","required":false,"paramType":"string"},{"name":"entryId","required":false,"paramType":"long"}]},{"name":"wordObject","fields":[{"name":"word","required":false,"paramType":"string"},{"name":"vulgar","required":false,"paramType":"string"}]},{"name":"wordOfTheDayList","fields":[{"name":"name","required":false,"paramType":"string"},{"name":"id","required":true,"paramType":"string"},{"name":"description","required":false,"paramType":"string"},{"name":"category","required":false,"paramType":"string"},{"name":"createdBy","required":false,"paramType":"string"},{"name":"items","required":false,"paramType":"List[WordOfTheDay]"},{"name":"subscriberCount","required":false,"paramType":"int"},{"name":"subscriptionStatus","required":false,"paramType":"string"},{"name":"createdAt","required":false,"paramType":"Date"},{"name":"commentCount","required":false,"paramType":"int"},{"name":"voteCount","required":false,"paramType":"integer"},{"name":"voteAverage","required":false,"paramType":"float"},{"name":"voteWeightedAverage","required":false,"paramType":"float"},{"name":"itemCount","required":false,"paramType":"int"},{"name":"firstItemDate","required":false,"paramType":"Date"},{"name":"lastItemDate","required":false,"paramType":"Date"},{"name":"subscriptionSchedule","required":false,"paramType":"string"},{"name":"subscriptionNamespace","required":false,"paramType":"string"},{"name":"subscriptionIdentifier","required":false,"paramType":"string"}]},{"name":"definition","fields":[{"name":"exampleUsage","required":false,"wrapperName":"exampleUses","paramType":"List[ExampleUsage]"},{"name":"word","required":false,"paramType":"string"},{"name":"text","required":false,"paramType":"string"},{"name":"textPron","required":false,"wrapperName":"textProns","paramType":"List[textPron]"},{"name":"score","required":false,"paramType":"float"},{"name":"partOfSpeech","required":false,"paramType":"string"},{"name":"note","required":false,"wrapperName":"notes","paramType":"List[note]"},{"name":"citation","required":false,"wrapperName":"citations","paramType":"List[citation]"},{"name":"relWord","required":false,"wrapperName":"relatedWords","paramType":"List[related]"},{"name":"sourceDictionary","required":false,"paramType":"string"},{"name":"label","required":false,"wrapperName":"labels","paramType":"List[Label]"},{"name":"sequence","required":false,"paramType":"string"},{"name":"seqString","required":false,"paramType":"string"},{"name":"extendedText","required":false,"paramType":"string"}]},{"name":"partOfSpeech","fields":[{"name":"roots","required":false,"paramType":"List[root]"}]},{"name":"contentProvider","fields":[{"name":"name","required":false,"paramType":"string"},{"name":"id","required":false,"paramType":"int"}]},{"name":"WordOfTheDay","fields":[{"name":"id","required":true,"paramType":"long"},{"name":"category","required":false,"paramType":"string"},{"name":"example","required":false,"wrapperName":"examples","paramType":"List[SimpleExample]"},{"name":"createdBy","required":false,"paramType":"string"},{"name":"word","required":false,"paramType":"string"},{"name":"definition","required":false,"wrapperName":"definitions","paramType":"List[SimpleDefinition]"},{"name":"contentProvider","required":false,"paramType":"contentProvider"},{"name":"createdAt","required":false,"paramType":"Date"},{"name":"publishDate","required":false,"paramType":"Date"},{"name":"parentId","required":false,"paramType":"string"},{"name":"note","required":false,"paramType":"string"},{"name":"htmlExtra","required":false,"paramType":"string"}]},{"name":"DefinitionSearchResults","fields":[{"name":"result","required":false,"wrapperName":"results","paramType":"List[definition]"},{"name":"totalResults","required":false,"paramType":"int"}]},{"name":"SubscriptionStatus","fields":[{"name":"name","required":false,"paramType":"string"},{"name":"id","required":false,"paramType":"int"}]},{"name":"SimpleDefinition","fields":[{"name":"text","required":false,"paramType":"string"},{"name":"partOfSpeech","required":false,"paramType":"string"},{"name":"note","required":false,"paramType":"string"},{"name":"source","required":false,"paramType":"string"}]},{"name":"SimpleExample","fields":[{"name":"url","required":false,"paramType":"string"},{"name":"text","required":false,"paramType":"string"},{"name":"title","required":false,"paramType":"string"},{"name":"id","required":false,"paramType":"long"}]},{"name":"EntrySearchResults","fields":[{"name":"searchResult","required":false,"wrapperName":"searchResults","paramType":"List[EntrySearchResult]"},{"name":"totalResults","required":false,"paramType":"int"}]}]}
@@ -27,8 +27,7 @@ module Wordnik
27
27
  end
28
28
  end
29
29
 
30
- # Define nickname
31
- self.nickname = Operation.nicknameify(self.http_method, self.endpoint.path, self.endpoint.resource.name)
30
+ self.nickname = self.suggested_name.underscore
32
31
  end
33
32
 
34
33
  # A globally unique identifier for the operation
@@ -71,21 +70,6 @@ module Wordnik
71
70
  parameter
72
71
  end.compact
73
72
  end
74
-
75
- # Generate a nickname using an HTTP method. This is used at operations initialization
76
- # and for doing backward searches to generate sample convenience calls from raw requests.
77
- def self.nicknameify(http_method, path, resource_name)
78
- [http_method, path].
79
- join("_"). # join http method and path
80
- gsub(/\{\w+\}/, ""). # remove path params
81
- tr("/", "_"). # replace slashes with underscores
82
- tr(' .', ''). # remove spaces and dots
83
- underscore. # underscore
84
- gsub(/_+/, "_"). # reduce multiple consective underscores to one
85
- gsub("_#{resource_name.to_s.underscore}", ""). # remove resource name
86
- gsub(/_$/, "") # remove underscore from end of string
87
- end
88
-
89
73
 
90
74
  end
91
75
 
@@ -105,7 +105,7 @@ module Wordnik
105
105
  qsp = {}
106
106
  self.params.each_pair do |key, value|
107
107
  next if self.path.include? "{#{key}}" # skip path params
108
- next if value.blank? # skip empties
108
+ next if value.blank? && value.class != FalseClass # skip empties
109
109
  value = "YOUR_API_KEY" if key.to_sym == :api_key && obfuscated # obscure the API key
110
110
  key = key.to_s.camelize(:lower).to_sym unless key.to_sym == :api_key # api_key is not a camelCased param
111
111
  qsp[key] = value.to_s
@@ -2,6 +2,7 @@
2
2
 
3
3
  module Wordnik
4
4
  class Resource
5
+
5
6
  require 'active_model'
6
7
  include ActiveModel::Validations
7
8
  include ActiveModel::Conversion
@@ -10,6 +11,10 @@ module Wordnik
10
11
  attr_accessor :name, :raw_data, :endpoints, :models
11
12
 
12
13
  validates_presence_of :name, :raw_data, :endpoints, :models
14
+
15
+ class << self
16
+ public :define_method
17
+ end
13
18
 
14
19
  def initialize(attributes = {})
15
20
  attributes.each do |name, value|
@@ -21,81 +26,15 @@ module Wordnik
21
26
  self.endpoints = self.raw_data['endPoints'].map do |endpointData|
22
27
  Endpoint.new(self, endpointData)
23
28
  end
24
- end
25
- end
26
-
27
- # Cycle through endpoints and their operations in search of
28
- # the path that corresponds to the given nickname
29
- def path_for_operation_nickname(nickname)
30
- self.endpoints.each do |endpoint|
31
- endpoint.operations.each do |operation|
32
- return endpoint.path if operation.nickname == nickname
33
- end
34
- end
35
- nil
36
- end
37
-
38
- # Uses the received method name and arguments to dynamically construct a Request
39
- # If the method name is prefixed with 'build_', then the 'unmade' Request
40
- # object will be returned instead of the Request Response's body
41
- #
42
- # Wordnik.word.get('dingo')
43
- # Wordnik.word.get_definitions('dingo', :limit => 20, )
44
- def method_missing(sym, *args, &block)
45
- nickname = sym.to_s
46
-
47
- # If method nickname starts with 'build_',
48
- # then just build the request but don't run it.
49
- if nickname =~ /^build_/
50
- nickname.gsub!('build_', '')
51
- build_only = true
52
- end
29
+ end
53
30
 
54
- # Extrapolate HTTP method from beginning of method name
55
- # e.g. 'post_words' -> :post
56
- http_method = nickname.split("_").first.to_sym
57
-
58
- # Ruby turns all key-value arguments at the end into a single hash
59
- # e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
60
- # becomes {:limit => 10, :part_of_speech => 'verb'}
61
- last_arg = args.pop if args.last.is_a?(Hash)
62
- last_arg = args.pop if args.last.is_a?(Array)
63
- last_arg ||= {}
64
-
65
- if [:post, :put].include?(http_method)
66
- params = nil
67
- body = last_arg
68
- else
69
- params = last_arg
70
- body = nil
71
- end
72
-
73
- # Find the path that corresponds to this method nickname
74
- # e.g. post_words -> "/wordList.{format}/{wordListId}/words"
75
- begin
76
- path = self.path_for_operation_nickname(nickname)
77
- rescue
78
- raise "Cannot find a resource path that corresponds to the method nickname '#{nickname}'"
79
- end
80
-
81
- # Take the '.{format}' portion out of the string so it doesn't interfere with
82
- # the interpolation we're going to do on the path.
83
- path.gsub!('.{format}', '')
84
-
85
- # Stick the remaining (required) arguments into the path string
86
- args.each do |arg|
87
- path.sub!(/\{\w+\}/, arg)
31
+ # Attach module containing metaprogramatticaly generated operations.
32
+ module_filename = File.join(File.dirname(__FILE__), "./resource_modules/#{self.name}.rb")
33
+ if File.exist? module_filename
34
+ self.class.send(:require, "wordnik/resource_modules/#{self.name}")
35
+ self.class.send(:include, "#{self.name.to_s.camelize}Methods".constantize)
88
36
  end
89
37
 
90
- # TODO: treat kwargs as body instead of params if request method is post or put
91
-
92
- request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
93
-
94
- if build_only
95
- request
96
- else
97
- request.response.body
98
- end
99
38
  end
100
39
 
101
40
  # It's an ActiveModel thing..