title: How to use a variable in API payload in Jupyter Notebook
body: <p>I'm using Jupyter Notebook to gather up a bunch of API calls then use various plotting tools to generate pretty graphs.</p>
  
  <p>I have the notebook working great when using constants in the API payload.  Now I'm trying to replace the constants with user entered variables and having some challenges.</p>
  
  <p>The following method for variable use works when the variable isn't part of a filter or function:</p>
  
  <p><code>key = input('Enter your subscription API Key then press Enter: ')</code></p>
  
  <p>When prompted, the user enters the key and that value is used perfectly fine in the following:</p>
  
  <pre><code>headers = {
     'X-Co-Integration-Key': key,
     'Content-Type': "application/json",
     'Cache-Control': "no-cache",
     }
  </code></pre>
  
  <p>Next, enter another variable for a guide called guideId:</p>
  
  <pre><code>guideId = input('Enter the Guide ID of the guide for which you want statistics then press Enter: ')
  </code></pre>
  
  <p>When prompted, the user enters the guideId and that value is stored, but I can't seem to get it to be used properly in the API payload.  </p>
  
  <p>I've tried several different methods of inserting the variable and the following gets me the closest to something that works:</p>
  
  <pre><code>{\n                \"filter\": \"id== \"" + guideId + "\n            }
  </code></pre>
  
  <p>The API call runs, but I get the following error:</p>
  
  <pre><code>{"overall": {"DeserializationError": "invalid character 'q' after object key:value pair"}, "fields": {"pipeline": "Required"}}
  </code></pre>
  
  <p>It looks like it is reading the variable and stopping after it hits the first character in the variable, which, in this case is a <code>q</code>.  </p>
  
  <p>I tried changing the variable to start with a number.  No change in behavior.</p>
  
  <p>I tried using <code>str(guideId)</code> - no change in behavior.</p>
  
  <p>I'm stumped.  Any ideas?</p>