This is a Hands on Lab contents for creating Cognitive Services by Java RESTful Web Service(JAX-RS).
Since 2017/1/17, the Cognitive service endpoint URL had changed to https://westus.api.cognitive.microsoft.com/face/v1.0?WT.mc_id=java-0000-yoterada.
Even now you are using the OLD url (https://api.projectoxford.ai/face/v1.0/ ), please modify the URL ASAP? The old API endpoints will be deprecated 90 days(on 4/15).
Then you can see following screen.
Then you can see following screen. So please "Sign up" by using (Microsoft account or GitHub or LinkedIn) account ?
After sign up the account, you can see following screen. If you get the key to access the cognitieve services, you can try it.
For example, Please search the key of "Face" and "Emotion" API as follows?
Then Please push the link of "Show"? You will be able see the access key like following detital number "3eef5*********************192a87".
After you get the access key, please go to the Face API site? Please push the menu of "APIs" on top of the screen? Then advanced menu will be showed and push the link of "Face"?
Then following "Face API" document site will be showed.
5. Push API Reference button
After you push the button, folliwng screen will be showed.
6. Push Open API Testing Console button
If you scroll down the screen, you can see the Open API Testing Console button. The please push the button?
If you push the button, some inpute text field will be showed on the screen. Then please input some parameters ? Especially pleaes input following parameters ?
A. returnFaceAttributes : age,gender,smile,facialhair,headpose,glasses
B. Ocp-Apim-Subscription-Key : 3eef5*********************192a87
Please input the Access key to the above field ?
C. Request body :
{
"url":"https://pbs.twimg.com/profile_images/1765776666/s-abetwitter1.png"
}
Please write the url of the picture (which is included a person who want to evaluate).
After input the parameters, please scroll down and you will be able to see the "Send" button. Then please push the button?
If there is no problem on the request and response, you can see following screen with Response Status Code as 200. If you can't get the response status code as 200, there is some miss configuration or request. So pleas modify the above configuration again ?
In order to create the application, you need to understand the HTTP method call, URL and Request body. So please understand what kind of the information is needed for the service invocation ?
POST https://westus.api.cognitive.microsoft.com/face/v1.0/detect?returnFaceId=true&returnFaceLandmarks=false&returnFaceAttributes=age,gender,smile,facialhair,headpose,glasses&WT.mc_id=java-0000-yoterada HTTP/1.1
Content-Type: application/json
Host: westus.api.cognitive.microsoft.com
Ocp-Apim-Subscription-Key: ••••••••••••••••••••••••••••••••
{
"url":"https://pbs.twimg.com/profile_images/1765776666/s-abetwitter1.png"
}
Create Cognitive Java Application with JAX-RS
Since 2017/1/17, the Cognitive service endpoint URL had changed to https://westus.api.cognitive.microsoft.com/face/v1.0?WT.mc_id=java-0000-yoterada.
Even now you are using the OLD url (https://api.projectoxford.ai/face/v1.0/ ), please modify the URL ASAP? The old API endpoints will be deprecated 90 days(on 4/15).