Answers.Body: <p>I tried the same but not with Postman but with a different application outside civicrm - I managed to create a contact without any error message </p>
  
  <p>so, Please try as below this should work</p>
  
  <blockquote>
    <p><a href="http://www.mysite.com/wp-content/plugins/civicrm/civicrm/extern/rest.php?entity=Contact&amp;action=create&amp;api_key=(myAPIkey)&amp;key=(mySiteKey)&amp;json=1&amp;contact_type=" rel="nofollow noreferrer">http://www.mysite.com/wp-content/plugins/civicrm/civicrm/extern/rest.php?entity=Contact&amp;action=create&amp;api_key=(myAPIkey)&amp;key=(mySiteKey)&amp;json=1&amp;contact_type=</a>'Individual'&amp;first_name='Tester'&amp;last_name='Yolanda'</p>
  </blockquote>
  
  <p>I guess this helps !!! </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-15T14:37:37.033Z
Answers.Text: What other program and parameters did you use?
Answers.UserDisplayName: SteadH
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-18T09:39:20.193Z
Answers.Text: I am trying to access this link from VB.NET web_request which worked alright also I did tried using POSTMAN too
Answers.UserDisplayName: Ramesh - ARTECH Consultancy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-15T10:34:34.877Z
Answers.LastActivityDate: 2017-12-15T10:54:22.217Z
Answers.LastEditDate: 2017-12-15T10:54:22.217Z
Answers.UserDisplayName: Ramesh - ARTECH Consultancy
Answers.Body: <p>As kainuk mentioned, you don't have the right syntax for the json field, i needs to be json= instead of json:</p>
  
  <pre><code>http://www.mysite.com/wp-content/plugins/civicrm/civicrm/extern/rest.php?entity=Contact&amp;action=create&amp;api_key=(myAPIkey)&amp;key=(mySiteKey)&amp;json={“contact_type":"Individual","first_name":"Tester","last_name":"Yolanda"}
  </code></pre>
  
  <p>(it needs to be post, not get for all operations like create that modify the database)</p>
  
  <p>and I would strongly recommend you to do rest over an encrypted connection (https instead of http), otherwise you risk having your keys being read by someone else than civi</p>
  
  <p>X+</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-18T14:40:23.313Z
Answers.LastActivityDate: 2017-12-18T14:40:23.313Z
Answers.UserDisplayName: Xavier
Body: <p>I'm new to CiviCRM and REST API Calls. I'm attempting to create a new contact using POST via Postman. I'm submitting the following:</p>
  
  <pre><code>http://www.mysite.com/wp-content/plugins/civicrm/civicrm/extern/rest.php?entity=Contact&amp;action=create&amp;api_key=(myAPIkey)&amp;key=(mySiteKey)&amp;json:{“contact_type":"Individual","first_name":"Tester","last_name":"Yolanda"}
  </code></pre>
  
  <p>But I get the response back:</p>
  
  <pre><code>     &lt;br /&gt;
      &lt;b&gt;Warning&lt;/b&gt;:  Invalid argument supplied for foreach() in
  &lt;b&gt;/wp-content/plugins/civicrm/civicrm/CRM/Utils/REST.php&lt;/b&gt; on line
  &lt;b&gt;167&lt;/b&gt;
  &lt;br /&gt;
  &lt;?xml version="1.0"?&gt;
  &lt;ResultSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" &gt;
        &lt;/ResultSet&gt;
  </code></pre>
  
  <p>I glanced at line 167 - it seems to be about constructing the response. I know I'm getting some kind of connection - If I change a character in the site or API key, I get "failed to authenticate" - so that part seems to be working.</p>
  
  <p>CiviCRM version 4.7.27, Wordpress version 4.9.1</p>
  
  <p>Thanks for any pointers!</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-15T07:26:54.730Z
Comments.Text: Hi SteadH. The ':' after the json argument,  Is it a typo? it should be a '='.
Comments.UserDisplayName: Kainuk - CiviCooP
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-22T05:36:52.417Z
Comments.Text: Thanks! It does seem to be. I started with the correct syntax but when I received a JSON error back even though it was valid, I started experimenting!
Comments.UserDisplayName: SteadH
Tags: <contacts><api><rest>
Title: CiviCRM REST API Call
ThreadText: # CiviCRM REST API Call
  
  (Asked by: username_0 on 2017-12-15)
  
  I'm new to CiviCRM and REST API Calls. I'm attempting to create a new contact using POST via Postman. I'm submitting the following:
  http://www.mysite.com/wp-content/plugins/civicrm/civicrm/extern/rest.php?entity=Contact&action=create&api_key=(myAPIkey)&key=(mySiteKey)&json:{“contact_type":"Individual","first_name":"Tester","last_name":"Yolanda"}
  
  But I get the response back:
       
      Warning:  Invalid argument supplied for foreach() in
  /wp-content/plugins/civicrm/civicrm/CRM/Utils/REST.php on line
  167
  
  
  
        
  
  I glanced at line 167 - it seems to be about constructing the response. I know I'm getting some kind of connection - If I change a character in the site or API key, I get "failed to authenticate" - so that part seems to be working.
  CiviCRM version 4.7.27, Wordpress version 4.9.1
  Thanks for any pointers!
  
  **Tags:** contacts, api, rest
  
  > **Comments:**
  > **username_1**: Hi username_0. The ':' after the json argument,  Is it a typo? it should be a '='.  
  > **username_0**: Thanks! It does seem to be. I started with the correct syntax but when I received a JSON error back even though it was valid, I started experimenting!  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2017-12-18. Score: 4 | Accepted answer
  
  As kainuk mentioned, you don't have the right syntax for the json field, i needs to be json= instead of json:
  http://www.mysite.com/wp-content/plugins/civicrm/civicrm/extern/rest.php?entity=Contact&action=create&api_key=(myAPIkey)&key=(mySiteKey)&json={“contact_type":"Individual","first_name":"Tester","last_name":"Yolanda"}
  
  (it needs to be post, not get for all operations like create that modify the database)
  and I would strongly recommend you to do rest over an encrypted connection (https instead of http), otherwise you risk having your keys being read by someone else than civi
  X+
  
  
  ---
  
  ### Answer by username_2 on 2017-12-15. Score: 0
  
  I tried the same but not with Postman but with a different application outside civicrm - I managed to create a contact without any error message
  
  so, Please try as below this should work
  
  > <http://www.mysite.com/wp-content/plugins/civicrm/civicrm/extern/rest.php?entity=Contact&action=create&api_key=(myAPIkey)&key=(mySiteKey)&json=1&contact_type=>'Individual'&first\_name='Tester'&last\_name='Yolanda'
  
  I guess this helps !!!
  
  > **Comments:**
  > **username_0**: What other program and parameters did you use?  
  > **username_2**: I am trying to access this link from VB.NET web_request which worked alright also I did tried using POSTMAN too  
  
  ---
  
  