Q:

google apps script post request to streak api

streak api: https://www.streak.com/api/
I tried to use this streak api with GAS UrlService and found the right syntax for get requests.  But I don't find the rigth syntax for put and post:
(1) f.e.  create box
    var RequestArguments = {
      "contentType": "application/json",
      "headers":{
        "User-Agent": "MY_APP_NAME",
        "Authorization": "Basic " + Utilities.base64Encode(streakApiKey),
       },
     "validateHttpsCertificates" :false,
     "method": "PUT",
     "????": "????" 
   }; 

  var result = UrlFetchApp.fetch(RequestUrl,RequestArguments);   

(2) f.e.  edit box
    var RequestArguments = {
     "contentType": "application/json",
     "headers":{
      "User-Agent": "MY_APP_NAME",
      "Authorization": "Basic " + Utilities.base64Encode(streakApiKey),
     },
     "validateHttpsCertificates":false,
     "method": "PUT",
     "????": "????" 
   }; 

  var result = UrlFetchApp.fetch(RequestUrl,RequestArguments);

A:

This is working:
function editBox() {
  var boxKey =      "xxx";
  var value = "{value:Test}";
  var fieldKey = "1001";
  //{name:"Deal Size", key:"1001", type:"TEXT_INPUT", lastUpdatedTimestamp:1457089319053}

  var url = 'https://www.streak.com/api/v1/boxes/' + boxKey + '/fields/' + fieldKey;

  var params = {
    headers: {Authorization: 'Basic ' + Utilities.base64Encode(streakApiKey)},
    method: "POST",
    payload: value,
    contentType: 'application/json'
  };

  var result = UrlFetchApp.fetch(url,params );

  var string = result.getContentText();
  var Object = JSON.parse(string);    

  return Object;
}

function createBox() {

  var pipelineKey = "xxx";
  var name = "sample box name";

  var url = 'https://www.streak.com/api/v1/pipelines/' + pipelineKey + '/boxes';

  var RequestArguments = {
    headers: {"Authorization": "Basic " + Utilities.base64Encode(streakApiKey)},
    method: "PUT",
    payload: {
      name: name
    }
  };

  var box = UrlFetchApp.fetch(url,RequestArguments);

  var result = JSON.parse(box.getContentText());

  return result;
}

