WordsAPI

免费增值
Verified
通过 dpventures | 已更新 한 달 전 | Data
人气

9.9 / 10

延迟

175ms

服务等级

100%

Health Check

N/A

返回所有讨论

HTTP Error 401: Unauthorized

Rapid account: Angelo Kai
AngeloKai
8년 전

I subscribed and got the basic plan. I tried to use the following example to test if the api is working. But it reports 401 unauthorized error. What is the problem:

# setup authentication
access_token = "5j5wVb9zMYmshXCrPGJJcZBQvfqDp1dRrRujsnMNc6AajHqAk6"
word = "lovely"
detail = "definitions"

try:
     # tried with api_server = "https://www.wordsapi.com"
     api_client = WordsAPI.swagger.ApiClient(api_server="https://wordsapiv1.p.mashape.com/words/")
     words_api = WordsAPI.WordsApi(api_client)
    response = words_api.details(access_token, word, detail)

    # To display structured information of a variable, please use var_dump: pip install var_dump
    # from var_dump import var_dump
    # var_dump(response)
    var_dump(response)

except Exception, e:
    print(e)

I will submit another question in private. I have two applications. But I didn’t add any API into the application. Should I do that?

加入讨论 - 在下面添加评论:

登录/注册以发布新的评论