WordsAPI

부분 유료
Verified
분류별 dpventures | 업데이트됨 il y a 24 jours | Data
인기

9.9 / 10

지연 시간

179ms

서비스 수준

100%

Health Check

N/A

모든 토론으로 돌아가기

HTTP Error 401: Unauthorized

Rapid account: Angelo Kai
AngeloKai
il y a 8 ans

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. I am able to access the api via curl but not with the following code. What is the problem:

# setup authentication
access_token = "Omitted since this is public "
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.

아래에 의견을 추가하고 토론에 참여하세요.

새 댓글을 게시하려면 로그인 / 가입