title: VSTS use API to set build parameters at queue time
body: <p>I need to queue a VSTS build from the REST API Documented at <a href="https://docs.microsoft.com/en-us/rest/api/vsts/build/builds/queue?view=vsts-rest-4.1" rel="noreferrer">https://docs.microsoft.com/en-us/rest/api/vsts/build/builds/queue?view=vsts-rest-4.1</a></p>
  
  <p><a href="https://stackoverflow.com/a/50483269/203963">This answer</a> helped me queue a basic build.
  I have been successful using a Personal Access Token (PAT) to authenticate and this json payload</p>
  
  <pre><code>{
      definition: {
          id: 19,
      }
  }
  </code></pre>
  
  <p>I need to pass variables into the build as well.  These are some of the things I have tried that are <strong>not working</strong></p>
  
  <p>Not working 1</p>
  
  <pre><code>{
      definition: {
          id: 19,
          variables: {
              "my.var.one": { allowOverride: true, isSecret: false, value: "stringvalue" },
              "my.var.two": { allowOverride: true, isSecret: false, value: "numberValue" }
          }
      }
  }
  </code></pre>
  
  <p>Not working 2</p>
  
  <pre><code>{
      definition: {
          id: 19,
          variables: {
              "my.var.one": { value: "stringvalue" },
              "my.var.two": { value: "numberValue" }
          }
      }
  }
  </code></pre>
  
  <p>Not working 3</p>
  
  <pre><code>{
      definition: {
          id: 19,
          variables: {
              "my.var.one": "stringvalue",
              "my.var.two": "numberValue"
          }
      }
  }
  </code></pre>
  
  <p>It was suggested <a href="https://stackoverflow.com/q/50176797/203963">this question</a> might have the answer since VSTS and TFS are similar.  Unfortunately changing to the parameters variable and using the string representation of the object gives the same result.  Removing the dots from the parameter names did not make a difference.  Trying with the API Version 3.1 also got the same result. </p>
  
  <p>Not working 4</p>
  
  <pre><code>{
      definition: {
          id: 19,
          parameters: '{
              "myVarOne": "stringValue",
              "myVarTwo": "numberValue"
          }'
      }
  }
  </code></pre>
  
  <p>What is the correct way to format variables in the payload (or other location) to pass them to the build you are trying to queue?</p>