title: How to specify a file in the 'filebody' in Python API post request?
body: <p>I am trying to post a file to sendinblue using API in Python and struggling with what to put instead of &quot;dataset1&quot;. It works if I manually type the file contents but not if I specify a file - I have tried csv, json, txt formats but nothing works. The error message says 'We could not find any valid email or SMS in the file you uploaded', I think it doesn't like the 'filebody' format.</p>
  <p>My code below:
  Any help greatly appreciated!</p>
  <pre><code>import requests
  
  url = &quot;https://api.sendinblue.com/v3/contacts/import&quot;
  
  payload = {
      &quot;listIds&quot;: [12],
      &quot;emailBlacklist&quot;: False,
      &quot;smsBlacklist&quot;: False,
      &quot;updateExistingContacts&quot;: True,
      &quot;emptyContactsAttributes&quot;: False,
      &quot;fileBody&quot;: &quot;dataset1&quot;
  
  headers = {
      &quot;accept&quot;: &quot;application/json&quot;,
      &quot;content-type&quot;: &quot;application/json&quot;,
      &quot;api-key&quot;: &quot;APIKEY&quot;
  }
  
  response = requests.request(&quot;POST&quot;, url, json=payload, headers=headers)
  
  
          
  print(response.text)
  </code></pre>