Update Brand
Update brand
PUT https://sandbox.com/v1/brands
Body
{
    "brand_id":63,
    "brand_name":"test brand 1111",
    "brand_name_ar":"test brand 11111 ar"
}Examples
curl --location --request PUT 'https://sandbox.mnasati.com/v1/brands' \
--header 'Authorization-jwt: Jwt eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2ZW5kb3JfaWQiOiIzIiwidXNlcl9pZCI6IjMzIiwidXNlcl90eXBlIjoidmVuZG9yIiwiZW1haWwiOiJxYTFAdWlndGMuY29tIiwiaWF0IjoxNjMzNTUzMjMzLCJleHAiOjE2Mzg3MzcyMzN9.tMjJ-tTcuvJUhM1zUR2zKC0uR2dSPOA_lmJemm8Gx8Q' \
--data-raw '{
    "brand_id":63,
    "brand_name":"test brand 1111",
    "brand_name_ar":"test brand 11111 ar"
}'<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sandbox.mnasati.com/v1/brands',
  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 =>'{
    "brand_id":63,
    "brand_name":"test brand 1111",
    "brand_name_ar":"test brand 11111 ar"
}',
  CURLOPT_HTTPHEADER => array(
    'Authorization-jwt: Jwt eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2ZW5kb3JfaWQiOiIzIiwidXNlcl9pZCI6IjMzIiwidXNlcl90eXBlIjoidmVuZG9yIiwiZW1haWwiOiJxYTFAdWlndGMuY29tIiwiaWF0IjoxNjMzNTUzMjMzLCJleHAiOjE2Mzg3MzcyMzN9.tMjJ-tTcuvJUhM1zUR2zKC0uR2dSPOA_lmJemm8Gx8Q'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;import http.client
conn = http.client.HTTPSConnection("sandbox.mnasati.com")
payload = "{\n    \"brand_id\":63,\n    \"brand_name\":\"test brand 1111\",\n    \"brand_name_ar\":\"test brand 11111 ar\"\n}"
headers = {
  'Authorization-jwt': 'Jwt eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2ZW5kb3JfaWQiOiIzIiwidXNlcl9pZCI6IjMzIiwidXNlcl90eXBlIjoidmVuZG9yIiwiZW1haWwiOiJxYTFAdWlndGMuY29tIiwiaWF0IjoxNjMzNTUzMjMzLCJleHAiOjE2Mzg3MzcyMzN9.tMjJ-tTcuvJUhM1zUR2zKC0uR2dSPOA_lmJemm8Gx8Q'
}
conn.request("PUT", "/v1/brands", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))var client = new RestClient("https://sandbox.mnasati.com/v1/brands");
client.Timeout = -1;
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization-jwt", "Jwt eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2ZW5kb3JfaWQiOiIzIiwidXNlcl9pZCI6IjMzIiwidXNlcl90eXBlIjoidmVuZG9yIiwiZW1haWwiOiJxYTFAdWlndGMuY29tIiwiaWF0IjoxNjMzNTUzMjMzLCJleHAiOjE2Mzg3MzcyMzN9.tMjJ-tTcuvJUhM1zUR2zKC0uR2dSPOA_lmJemm8Gx8Q");
var body = @"{" + "\n" +
@"    ""brand_id"":63," + "\n" +
@"    ""brand_name"":""test brand 1111""," + "\n" +
@"    ""brand_name_ar"":""test brand 11111 ar""" + "\n" +
@"}";
request.AddParameter("text/plain", body,  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "{\n    \"brand_id\":63,\n    \"brand_name\":\"test brand 1111\",\n    \"brand_name_ar\":\"test brand 11111 ar\"\n}");
Request request = new Request.Builder()
  .url("https://sandbox.mnasati.com/v1/brands")
  .method("PUT", body)
  .addHeader("Authorization-jwt", "Jwt eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2ZW5kb3JfaWQiOiIzIiwidXNlcl9pZCI6IjMzIiwidXNlcl90eXBlIjoidmVuZG9yIiwiZW1haWwiOiJxYTFAdWlndGMuY29tIiwiaWF0IjoxNjMzNTUzMjMzLCJleHAiOjE2Mzg3MzcyMzN9.tMjJ-tTcuvJUhM1zUR2zKC0uR2dSPOA_lmJemm8Gx8Q")
  .build();
Response response = client.newCall(request).execute();Last updated
Was this helpful?