Azure / Azure/AzureCognitive

Examples not working

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
R
Stars
12
Forks
14
PR merge metrics
No merged PRs in 30d

Description

examples mentioned in the documentation are not working

```
img_link <- "https://news.microsoft.com/uploads/2014/09/billg1_print.jpg"
call_cognitive_endpoint(
vision$get_endpoint(),
operation="analyze",
body=list(url=img_link),
options=list(details="celebrities"),
http_verb="POST"
)

download.file(url = img_link,destfile = 'd:/y.jpg', mode = 'wb')
img_raw <- readBin("d:/y.jpg", "raw", file.info("d:/y.jpg")$size)
call_cognitive_endpoint(
vision$get_endpoint(),
operation = "analyze",
body = img_raw,
encode = "raw",
http_verb = "POST"
)

```
I get this error while doing it. In both the commands.

```
Error in process_cognitive_response(response = res, handler = match.arg(http_status_handler), :
Unauthorized (HTTP 401). Failed to complete Cognitive Services operation. Message:
Access denied due to invalid subscription key or wrong API endpoint. Make
sure to provide a valid key for an active subscription and use a correct
regional API endpoint for your resource.
```

Let me know if I am doing something wrong here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.