Get logo list
1 |
GET /api/1/logo |
Parameters
Name | Parameter Type |
Allow Multiple |
Required/ Optional |
Data Type | Description |
---|---|---|---|---|---|
Authorization: | Header | False | Required | String (Bearer {access token}) | Pass the authentication token that was granted when you authorized access |
Request
HTTP
Following is an example HTTP request:
1 2 3 4 |
GET /api/1/logo HTTP/1.1 Host: restapi.actonsoftware.com Authorization: Bearer 45cde4bdb39141fd455235a87de7dfb Cache-Control: no-cache |
HTTP
Following is an example curl request:
1 |
curl -X GET -H "Authorization: Bearer 45cde4bdb39141fd455235a87de7dfb" -H "Cache-Control: no-cache" https://restapi.actonsoftware.com/api/1/logo |
Response
If the request succeeds, you’ll get an HTTP 200 response with a JSON object. Here’s the JSON response from the request made with JSON above:
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 |
{ offset: 0 count: 2 totalCount: 2 result: [2] 0: { url_str: "https://cdn1.actonsoftware.com/acton/cx/cb/logo2.png" url_str_ts: "https://cdn1.actonsoftware.com/acton/cx/cb/logo2.png?ts=1411363236955" alt_txt: "" tool_tip: "" target_url: "" id: "i-4" title: "Logo #2 -- System" } - 1: { url_str: "http://localhost/acton/cx/1/logo6.png" url_str_ts: "http://localhost/acton/cx/1/logo6.png?ts=1411363236955" alt_txt: "testalt" tool_tip: "testhover" target_url: "https://www.google.co.in/" id: "i-5" title: "TestLogo" } - - } |
Code Examples
The java code examples use the java unirest library available at <a href=”http://unirest.io/”>unirest.io</a>. You can also find unirest libraries for node, ruby, php, java, objective c, python, and .net.
Java
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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
package content; import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.JsonNode; import com.mashape.unirest.http.Unirest; import com.mashape.unirest.http.exceptions.UnirestException; import org.json.JSONObject; import util.Utility; public class GetLogoExample { static String BASE_URL = "https://restapi.actonsoftware.com/"; public static void main(String[] args) { getLogo(); getLogoById(); } public static void getLogo(){ try { String accessToken = Utility.getAccessToken(); Unirest.setHttpClient(Utility.makeClient()); Unirest.setDefaultHeader("Authorization", "Bearer " + accessToken); HttpResponse<JsonNode> jsonResponse = Unirest.get(BASE_URL + "api/1/logo") .header("accept", "application/json") .asJson(); if(jsonResponse.getCode()==200){ JSONObject jsonResponseBody = jsonResponse.getBody().getObject(); System.out.println("The response body is : "+jsonResponseBody ); }else { System.out.println("The response is : "+ jsonResponse); } } catch (UnirestException e) { e.printStackTrace(); } } public static void getLogoById(){ try { String accessToken = Utility.getAccessToken(); Unirest.setHttpClient(Utility.makeClient()); // provide logoid String id = "<Provide Logo Id>"; Unirest.setHttpClient(Utility.makeClient()); Unirest.setDefaultHeader("Authorization", "Bearer " +accessToken ); HttpResponse jsonResponse = Unirest.get(BASE_URL + "api/1/logo/"+id) .header("accept", "application/json") .asJson(); if(jsonResponse.getCode()==200){ JSONObject jsonResponseBody = ((JsonNode)jsonResponse.getBody()).getObject(); System.out.println("The response body is : "+jsonResponseBody ); }else { System.out.println("The response is : "+ jsonResponse); } } catch (UnirestException e) { e.printStackTrace(); } } } |