Argument ExceptionMethod: Translate()Parameter: Message: The received token is of incorrect token type

Gretha Victoria Walther 1 Reputation point
2022-04-20T08:35:44.153+00:00

I am calling the Microsoft Translation API in R using the "translateR" package in R.

This is the code:

translated_tweets <- translateR::translate(dataset = Tweets,
                                             content.field = 'text', 
                                             microsoft.api.key  = "XXX",
                                             target.lang = 'en',
                                            source.lang = "am",
                                            microsoft.token = TRUE)

The code works. However, when I look at the results, the new column "translatedContents" is showing this error message:

Argument ExceptionMethod: Translate()Parameter: Message: The received token is of incorrect token type
Azure Translator
Azure Translator
An Azure service to easily conduct machine translation with a simple REST API call.
248 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. romungi-MSFT 32,451 Reputation points Microsoft Employee
    2022-04-20T12:29:43.637+00:00

    @Gretha Victoria Walther Based on the TranslateR official documentation page the arguments for microsoft translation API seem to be the following:

    microsoft.client.id  
    microsoft.client.secret  
    

    Could you try updating the arguments and check if this is the issue?

    Also, could you try calling the Azure translation API through a rest call and check if the passed keys are correct?

    If an answer is helpful, please click on 130616-image.png or upvote 130671-image.png which might help other community members reading this thread.