Update Support

Update Support

Purpose

To update the support/location detail of your organization.

Request URL

https://live.membroz.com/api/supports/[supportid]

Request Method

PUT
Note
  • Send authkey in https header
  • You must use only Field API names in the input. You can obtain the field API names from Fields metadata API
  • Enterprise customer can replace domain name with their hosting Url. for example https://app.xyz.com/api/supports
  • API return updated support data in json format or return error message.

Request JSON

Attribute Data Type Mandatory Description
SUPPORTID String Yes The record ID of the support you want to update. it is pass in request
/api/supports/[supportid]

Sample Request

curl --location --request PUT 'https://live.membroz.com/api/supports/[supportid]'\
--header 'authkey: XXXXXXXXXX' \
--header 'Content-Type: application/json' \
--data-raw '{
    "supportfor": "Member",
    "attachments": [],
    "_id": "5f756a66d698d643837e2f22",
    "subject": "test",
    "memberid": "5e9598377fb65a4204aab603",
    "category": "Support",
    "content": "test desc",
    "response": [],
    "branchid": "5e954c7b9df11624f81e7859",
    "addedby": "5e954c7b9df11624f81e785b",
    "status": "Open",
    "createdAt": "2020-10-01T05:34:30.846Z",
    "updatedAt": "2020-10-01T05:34:30.846Z",
    "updatedby": "5e954c7b9df11624f81e785b"
}'
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\r\n    \"supportfor\": \"Member\",\r\n    \"attachments\": [],\r\n    \"_id\": \"5f756a66d698d643837e2f22\",\r\n    \"subject\": \"test\",\r\n    \"memberid\": \"5e9598377fb65a4204aab603\",\r\n    \"category\": \"Support\",\r\n    \"content\": \"test desc\",\r\n    \"response\": [],\r\n    \"branchid\": \"5e954c7b9df11624f81e7859\",\r\n    \"addedby\": \"5e954c7b9df11624f81e785b\",\r\n    \"status\": \"Open\",\r\n    \"createdAt\": \"2020-10-01T05:34:30.846Z\",\r\n    \"updatedAt\": \"2020-10-01T05:34:30.846Z\",\r\n    \"updatedby\": \"5e954c7b9df11624f81e785b\"\r\n}");
Request request = new Request.Builder()
  .url("https://live.membroz.com/api/supports/[supportid]")
  .method("PUT", body)
  .addHeader("authkey", "XXXXXXXXXX")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();
 "https://live.membroz.com/api/supports/[supportid]",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS =>"{\r\n    \"supportfor\": \"Member\",\r\n    \"attachments\": [],\r\n    \"_id\": \"5f756a66d698d643837e2f22\",\r\n    \"subject\": \"test\",\r\n    \"memberid\": \"5e9598377fb65a4204aab603\",\r\n    \"category\": \"Support\",\r\n    \"content\": \"test desc\",\r\n    \"response\": [],\r\n    \"branchid\": \"5e954c7b9df11624f81e7859\",\r\n    \"addedby\": \"5e954c7b9df11624f81e785b\",\r\n    \"status\": \"Open\",\r\n    \"createdAt\": \"2020-10-01T05:34:30.846Z\",\r\n    \"updatedAt\": \"2020-10-01T05:34:30.846Z\",\r\n    \"updatedby\": \"5e954c7b9df11624f81e785b\"\r\n}",
  CURLOPT_HTTPHEADER => array(
    "authkey: XXXXXXXXXX",
    "Content-Type: application/json"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://live.membroz.com/api/supports/[supportid]"

payload = "{\r\n    \"supportfor\": \"Member\",\r\n    \"attachments\": [],\r\n    \"_id\": \"5f756a66d698d643837e2f22\",\r\n    \"subject\": \"test\",\r\n    \"memberid\": \"5e9598377fb65a4204aab603\",\r\n    \"category\": \"Support\",\r\n    \"content\": \"test desc\",\r\n    \"response\": [],\r\n    \"branchid\": \"5e954c7b9df11624f81e7859\",\r\n    \"addedby\": \"5e954c7b9df11624f81e785b\",\r\n    \"status\": \"Open\",\r\n    \"createdAt\": \"2020-10-01T05:34:30.846Z\",\r\n    \"updatedAt\": \"2020-10-01T05:34:30.846Z\",\r\n    \"updatedby\": \"5e954c7b9df11624f81e785b\"\r\n}"
headers = {
  'authkey': 'XXXXXXXXXX',
  'Content-Type': 'application/json'
}

response = requests.request("PUT", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
require "uri"
require "net/http"

url = URI("https://live.membroz.com/api/supports/[supportid]")

https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true

request = Net::HTTP::Put.new(url)
request["authkey"] = "XXXXXXXXXX"
request["Content-Type"] = "application/json"
request.body = "{\r\n    \"supportfor\": \"Member\",\r\n    \"attachments\": [],\r\n    \"_id\": \"5f756a66d698d643837e2f22\",\r\n    \"subject\": \"test\",\r\n    \"memberid\": \"5e9598377fb65a4204aab603\",\r\n    \"category\": \"Support\",\r\n    \"content\": \"test desc\",\r\n    \"response\": [],\r\n    \"branchid\": \"5e954c7b9df11624f81e7859\",\r\n    \"addedby\": \"5e954c7b9df11624f81e785b\",\r\n    \"status\": \"Open\",\r\n    \"createdAt\": \"2020-10-01T05:34:30.846Z\",\r\n    \"updatedAt\": \"2020-10-01T05:34:30.846Z\",\r\n    \"updatedby\": \"5e954c7b9df11624f81e785b\"\r\n}"

response = https.request(request)
puts response.read_body
var client = new RestClient("https://live.membroz.com/api/supports/[supportid]");
client.Timeout = -1;
var request = new RestRequest(Method.PUT);
request.AddHeader("authkey", "XXXXXXXXXX");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\r\n    \"supportfor\": \"Member\",\r\n    \"attachments\": [],\r\n    \"_id\": \"5f756a66d698d643837e2f22\",\r\n    \"subject\": \"test\",\r\n    \"memberid\": \"5e9598377fb65a4204aab603\",\r\n    \"category\": \"Support\",\r\n    \"content\": \"test desc\",\r\n    \"response\": [],\r\n    \"branchid\": \"5e954c7b9df11624f81e7859\",\r\n    \"addedby\": \"5e954c7b9df11624f81e785b\",\r\n    \"status\": \"Open\",\r\n    \"createdAt\": \"2020-10-01T05:34:30.846Z\",\r\n    \"updatedAt\": \"2020-10-01T05:34:30.846Z\",\r\n    \"updatedby\": \"5e954c7b9df11624f81e785b\"\r\n}",  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

Possible Errors

HTTP Status Error Code Message Reason
permission denied 403 You do not have permission

Sample Response

{
    "supportfor": "Member",
    "attachments": [],
    "_id": "5f756a66d698d643837e2f22",
    "subject": "test",
    "memberid": "5e9598377fb65a4204aab603",
    "category": "Support",
    "content": "test desc",
    "response": [],
    "branchid": "5e954c7b9df11624f81e7859",
    "addedby": "5e954c7b9df11624f81e785b",
    "status": "Open",
    "createdAt": "2020-10-01T05:34:30.846Z",
    "updatedAt": "2020-10-01T05:37:13.015Z",
    "updatedby": "5e954c7b9df11624f81e785b"
}
Send Message
Hello!
How can we help!