Update a Logo
PUT https://restapi.actonsoftware.com/api/1/logo/{id}
This endpoint allows you to update an existing logo in the account.
Parameters
Name | Parameter Type |
Allow Multiple |
Required/ Optional |
Data Type | Description |
---|---|---|---|---|---|
Authorization: | Header | False | Required | String | Insert your generated access token. (Bearer {access token}) |
logoid | Path | False | Required | String | Specify the ID of the logo. |
name | Form | False | Required | String | Specify a name for the image. |
alttext | Form | False | Optional | String | Specify the alternative text for the image. |
tooltip | Form | False | Optional | String | Specify the text to display when hovering over the image. |
targeturl | Form | False | Optional | String | Specify the target URL for the image. |
Response
{ "status": "success", "message": "The logo has been updated", "id": "i-5" }
Code Examples
cURLPythonJava
curl -X PUT https://restapi.actonsoftware.com/api/1/logo/i-5 -H "authorization: Bearer 12345678-9abc-defg-hijk-lmnopqrs" -H "content-type: multipart/form-data" -F "name=new-name"
import requests url = "https://restapi.actonsoftware.com/api/1/logo/i-5" data = {'name': 'new-name'} headers = { 'authorization': 'Bearer b78d2252-8c86-3d8c-bd8e-ff62a6fc057c', } response = requests.request("PUT", url, headers=headers, data = data) print(response.text.encode('utf8'))
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; import java.io.File; public class PutLogoExample { static String BASE_URL = "https://restapi.actonsoftware.com/api/1/"; public static void main(String[] args) { putLogoUsingFile(); putLogoUsingImageUrl(); } public static void putLogoUsingImageUrl() { try { String imagelink = "<Provide image link url>"; String id = "<Provide logo id>"; String accessToken = Utility.getAccessToken(); Unirest.setHttpClient(Utility.makeClient()); Unirest.setDefaultHeader("Authorization", "Bearer " + accessToken); HttpResponse<String> jsonResponse = Unirest.put(BASE_URL + "logo/"+id) .header("accept", "application/json") .field("name", "testapiputlogo") .field("alttext", "testapiputalttext") .field("tooltip", "testapiputtooltip") .field("targeturl", "https://yahoo.com/") .asString(); if(jsonResponse.getCode()==200){ String jsonResponseBody = jsonResponse.getBody(); System.out.println("The response body is : "+jsonResponseBody ); }else { System.out.println("The response is : "+ jsonResponse); } } catch (UnirestException e) { e.printStackTrace(); } } public static void putLogoUsingFile() { try { File file = new File("<Provide Logo image>"); String id = "<Provide logo id>"; String accessToken = Utility.getAccessToken(); Unirest.setHttpClient(Utility.makeClient()); Unirest.setDefaultHeader("Authorization", "Bearer " + accessToken); HttpResponse<String> jsonResponse = Unirest.put(BASE_URL + "logo/"+id) .header("accept", "application/json") .field("name", "testapiputlogo2") .field("alttext", "testapiputalttext2") .field("tooltip", "testapiputtooltip2") .field("targeturl", "https://yahoo.com/") .asString(); if(jsonResponse.getCode()==200){ String jsonResponseBody = jsonResponse.getBody(); System.out.println("The response body is : "+jsonResponseBody ); }else { System.out.println("The response is : "+ jsonResponse); } } catch (UnirestException e) { e.printStackTrace(); } } }