I registered for the semantics3 API so that I could use their UPC/EAN Product Search feature and I received my APIkey and APIsecret. Now, I want to make a propper Get request to test it and then eventually incorporate it in my own application. I downloaded the semantics3 java project from their GitHub page..
Anyways, how do I actually make an UPC/EAN query with my own UPC or EAN code, so that I could get the JSON response for the product I'm searching for?
The constructor of the Semantics3Request looks like this:
public Semantics3Request(String apiKey, String apiSecret, String endpoint) {
if (apiKey == null) {
throw new Semantics3Exception(
"API Credentials Missing",
"You did not supply an apiKey. Please sign up at https://semantics3.com/ to obtain your api_key."
);
}
if (apiSecret == null) {
throw new Semantics3Exception(
"API Credentials Missing",
"You did not supply an apiSecret. Please sign up at https://semantics3.com/ to obtain your api_key."
);
}
this.apiKey = apiKey;
this.apiSecret = apiSecret;
this.endpoint = endpoint;
this.consumer = new DefaultOAuthConsumer(apiKey, apiSecret);
consumer.setTokenWithSecret("", "");
}
One mroe important thing is that I do not understand what should I put in the String endpoint
so that I can later call the methods from the Sematics3Request class: add
, runQuery
, fetch
and get
methods which returns a JSON response.