About this endpoint
The links endpoint will retrieve link results configured in the empathy dashboard.
Created by Iago Fernández · last update December 10, 2019
The links endpoint will retrieve link results configured in the empathy dashboard.
Here is a simple implementation in Java to consume this endpoint
1
2
3
4
5
6
7
8
9
10
11
12
13
Client client;
WebTarget target;
public void init(){
client = ClientBuilder.newClient();
target = client.target("https://api.empathybroker.com/search/v1/query/{instance_id}/links")
.queryParam("lang","ES") //Query parameters
.queryParam("m",10)
}
public JSON getResponse(String query){
return target.queryParam("query",query).request(MediaType.APPLICATION_JSON).get(JSON.class)
}
The links endpoint will return a Json reponse that look like this.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{
banner: [
{
/*Link identifier (self generating value)*/
id: "546dd382e4b08960f81c1392",
/*Link title. It may contain highlighted text (configured when the link is created in the dashboard)*/
title: "Promoted Banner Test Link",
/*Link subtitle (configured when the link is created in the dashboard)*/
subtitle: "",
/*Link portal (configured when the link is created in the dashboard)*/
portal: "",
/*Link scope (configured when the link is created in the dashboard)*/
scope: "",
/*Link title without highlighted text*/
title_raw: "Promoted Banner Test Link",
/*Link subtitle without highlighted text*/
subtitle_raw: "",
/*Destination url (configured when the link is created in the dashboard)*/
url: "http://www.testlink.com",
/*Destination url but using the tagging system to register the click*/
trackable_url: "TRACKABLE_TEST_LINK",
/*Image url (configured when the link is created in the dashboard)*/
imagename: "IMAGE_NAME"
}
],
promoted: [
{
id: "546dd382e4b08960f81c1395",
title: "Promoted Test Link",
subtitle: "",
portal: "",
scope: "",
title_raw: "Promoted Test Link",
subtitle_raw: "",
url: "http://www.testlink.com",
trackable_url: "TRACKABLE_TEST_LINK",
imagename: "IMAGE_NAME"
}
],
direct: [
{
id: "54a17583e4b08f7d3fcfd8a9",
title: "Direct Test Link",
subtitle: "",
portal: "",
scope: "",
title_raw: "Direct Test Link",
subtitle_raw: "",
url: "http://www.testlink.com",
trackable_url: "TRACKABLE_TEST_LINK",
imagename: "IMAGE_NAME"
}
]
}