Botometer Pro

免费增值
通过 Observatory on Social Media | 已更新 il y a 22 jours | Social
人气

9.3 / 10

延迟

1,141ms

服务等级

100%

Health Check

N/A

返回所有讨论

API Error Response Help

Rapid account: Betatek
betatek
il y a 6 ans

I am getting the error “Missing Mashape application key” when I send the post request with Unirest PHP.

I always get an error response despite using the API keys provided;

Unirest\Response Object ( [code] => 401 [raw_body] => [body] => [headers] => Array ( [{“message”] => “Missing Mashape application key. Go to http://docs.mashape.com/api-keys to learn how to get your API application key.”} ) )

We used two API keys. We get the same error for both. First one is found when I go to the “Default Application” page, click on the “Get the Key” button located on the top right section of the screen.

The second one is found when I go to “https://market.mashape.com/OSoMe/botometer-pro” page and select the “Default Application” to Request Headers section. I then copy the Mashape API key on the right side of Request Example in the PHP section.

First My-Mashape-Key: us2J0mWtAbmsh0Muacm72IDLqmZJp1jNGKNjsniA0fjlQbERY9
Second My-Mashape-Key: o6eVPWP9rRmsh9GM4T7WKa4joboVp1bVOOajsnCv0aP0kcjjEm

My request code;

$response = Unirest\Request::post(“https://botometer-pro.p.mashape.com/2/check_account”,
array(
“X-Mashape-Key” => “My-Mashape-Key”,
“Content-Type” => “application/json”,
“Accept” => “application/json”
),
json_encode(array(“user” => array(“id” => “590030385”, “screen_name” => “murat_basci”),
“timeline” => $timeline,
“mentions” => $mentions->statuses))

);

Thanks in advance for all your help.

Rapid account: O So Me
OSoMe Commented il y a 6 ans

We’re really not able to provide support for the unirest libraries. We know that Mashape’s code snippet for at least one language (Ruby) is incorrect, and none of us here know about PHP in particular.

With that said, first, your mashape keys are private and you shouldn’t post them here. If you can edit your post, you should do so ASAP.

Second, and this might be obvious, but I see in your request code that "X-Mashape-Key" => "My-Mashape-Key". Are you sending the literal "My-Mashape-Key" along? Or is that where you paste your key in your code?

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

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