Answers.Body: <p>You'll have an easier time modifying the permissions from within CiviCRM - <strong>Administer menu &gt;&gt; Users and Permissions &gt;&gt; Permissions (Access Control)</strong>.  When changing permissions from WP, you're usually dealing with machine names, not human-readable labels, so it can be hard to correlate error messages with the particular permission needed.</p>
  <p>It sounds like your REST user still doesn't have the <em>Access CiviContribute</em> permission.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-21T21:46:36.320Z
Answers.Text: Thanks. I am an Administrator so I should basically have full access to everything. Stil I have met a total blocking here.
Answers.UserDisplayName: Claes Rickeby
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-21T23:26:38.153Z
Answers.Text: Can you edit your question to show a command-line CURL operation that duplicates the error (with both the command and the error)?  If you do, please comment on this answer so I'll get a notification!
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-21T23:26:51.560Z
Answers.Text: You may also want to ask in the ~dev channel on https://chat.civicrm.org.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-23T13:44:15.243Z
Answers.Text: Jon, I'm really sorry, but I don't really know how to do that. I am trying to make the access via a Python programme. I can provide you with the call that gives the answer above. I'll run it and post it here.
Answers.UserDisplayName: Claes Rickeby
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-24T21:27:41.190Z
Answers.Text: Jon, I have now succeeded to proceed a bit. It has been suggested on the Mattermost site that I used the wrong API access way. It should be via the WP- aAPI v3 wrapper, so I tried it. Wasn't successful, but I have done some curl accesses. Please see the results I got from a a v3 access effort:
Answers.UserDisplayName: Claes Rickeby
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-24T21:30:26.317Z
Answers.Text: Claess-MBP:~ claesrickeby$ curl https://mdl.medborgerligsamling.se/wp-json/civicrm/v3/rest?entity=Contact&action=getvalue&api_key=x&key=y&json={"return" : "street_address","id":6570} -v
  [1] 91058
  [2] 91059
  [3] 91060
  [4] 91061
  [2]   Done                    action=getvalue
  [3]-  Done                    api_key=x
  [4]+  Done                    key=y
  Claess-MBP:~ claesrickeby$ {"code":"rest_cannot_access","message":"No one can access the REST API.","data":{"status":401}}
Answers.UserDisplayName: Claes Rickeby
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-24T21:30:32.213Z
Answers.Text: I do not know if you can get any sense from the information. Seems to be. permission problem. I am an admin and also a special Role apiUser, with the whole set of accesses Granted.
Answers.UserDisplayName: Claes Rickeby
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-24T21:33:35.077Z
Answers.Text: @ClaesRickeby That's helpful.  The error you're seeing is a WP error, not a Civi error.  There's [this page](https://wordpress.org/support/topic/401-error-on-form-submission-rest_cannot_access/) that mentions a plugin that causes this error.  Are you able to access the WP REST API for non-Civi data?
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-25T14:23:37.063Z
Answers.Text: Perhaps this gives some progress. I have tried the WP APi wrapper for Civi, v3. I got the following response.:
  
  raise InvalidSchema("No connection adapters were found for {!r}".format(url))
  requests.exceptions.InvalidSchema: No connection adapters were found for '"https://mdl.medborgerligsamling.se/wp-json/civicrm/v3/rest?key=site_key&api_key=apiKey&id=1795"'
  
  Does this provide any further help. i'am really at a loss when it comes to these items. Thanks for helping out!
Answers.UserDisplayName: Claes Rickeby
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-25T14:29:33.647Z
Answers.Text: I do not know if I can reach the WP Rest API for nonCivi data. I should have Administrator rights for the civi system but don't really know if it is ok for me to access the WP level.
Answers.UserDisplayName: Claes Rickeby
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-25T14:43:56.733Z
Answers.Text: Jon, I have also worked a bit with curl so if that could help I could try to provide more info with your guidance.
Answers.UserDisplayName: Claes Rickeby
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-19T13:46:26.577Z
Answers.LastActivityDate: 2021-02-19T13:46:26.577Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>I am progressing deeper and deeper into CivCRM intricacies, and work with External (https://) access of the database via API's. When performing a python
  requests.get(....,entity=Contact,action=get) it works OK, and I get the data I request.</p>
  <p>Next I tried to update the contact/membership with a payment via
  requests.get(...entity=Contribution, action=create...) and the same for requests.post, both gave the same disappointing  status_code of 414. I also tried to get some more information and among the plethora of data dumped the following was &quot;readable&quot;:</p>
  <p><em>&quot;is_error&quot;:1,&quot;error_message&quot;:&quot;API permission check failed for Contribution/create call; insufficient permission: require access CiviCRM and access CiviContribute and edit contributions&quot;},</em> as well as a status_code of 414 (unknown to me)</p>
  <p>I have now updated my access-capabilities (granted all &quot;Edit Capabilities: Custom) in the role table in WP (where our CiviCRM resides), so I shall have all the rights mentioned above. Still the same problem. We run API 3 at present, but I do not think that is the problem here.</p>
  <p>So here I am asking for some guidance, please!</p>
  <p>Claes</p>
  
Tags: <api>
Title: Extrnal API access. Status_code 414
ThreadText: # Extrnal API access. Status_code 414
  
  (Asked by: username_0 on 2021-02-19)
  
  I am progressing deeper and deeper into CivCRM intricacies, and work with External (https://) access of the database via API's. When performing a python
  requests.get(....,entity=Contact,action=get) it works OK, and I get the data I request.
  
  Next I tried to update the contact/membership with a payment via
  requests.get(...entity=Contribution, action=create...) and the same for requests.post, both gave the same disappointing status\_code of 414. I also tried to get some more information and among the plethora of data dumped the following was "readable":
  
  *"is\_error":1,"error\_message":"API permission check failed for Contribution/create call; insufficient permission: require access CiviCRM and access CiviContribute and edit contributions"},* as well as a status\_code of 414 (unknown to me)
  
  I have now updated my access-capabilities (granted all "Edit Capabilities: Custom) in the role table in WP (where our CiviCRM resides), so I shall have all the rights mentioned above. Still the same problem. We run API 3 at present, but I do not think that is the problem here.
  
  So here I am asking for some guidance, please!
  
  username_0
  
  **Tags:** api
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-02-19. Score: 1
  
  You'll have an easier time modifying the permissions from within CiviCRM - **Administer menu >> Users and Permissions >> Permissions (Access Control)**. When changing permissions from WP, you're usually dealing with machine names, not human-readable labels, so it can be hard to correlate error messages with the particular permission needed.
  
  It sounds like your REST user still doesn't have the *Access CiviContribute* permission.
  
  > **Comments:**
  > **username_0**: Thanks. I am an Administrator so I should basically have full access to everything. Stil I have met a total blocking here.  
  > **username_1**: Can you edit your question to show a command-line CURL operation that duplicates the error (with both the command and the error)?  If you do, please comment on this answer so I'll get a notification!  
  > **username_1**: You may also want to ask in the ~dev channel on https://chat.civicrm.org.  
  > **username_0**: Jon, I'm really sorry, but I don't really know how to do that. I am trying to make the access via a Python programme. I can provide you with the call that gives the answer above. I'll run it and post it here.  
  > **username_0**: Jon, I have now succeeded to proceed a bit. It has been suggested on the Mattermost site that I used the wrong API access way. It should be via the WP- aAPI v3 wrapper, so I tried it. Wasn't successful, but I have done some curl accesses. Please see the results I got from a a v3 access effort:  
  > **username_0**: Claess-MBP:~ username_0$ curl https://mdl.medborgerligsamling.se/wp-json/civicrm/v3/rest?entity=Contact&action=getvalue&api_key=x&key=y&json={"return" : "street_address","id":6570} -v [1] 91058 [2] 91059 [3] 91060 [4] 91061 [2]   Done                    action=getvalue [3]-  Done                    api_key=x [4]+  Done                    key=y Claess-MBP:~ username_0$ {"code":"rest_cannot_access","message":"No one can access the REST API.","data":{"status":401}}  
  > **username_0**: I do not know if you can get any sense from the information. Seems to be. permission problem. I am an admin and also a special Role apiUser, with the whole set of accesses Granted.  
  > **username_1**: @username_0 That's helpful.  The error you're seeing is a WP error, not a Civi error.  There's [this page](https://wordpress.org/support/topic/401-error-on-form-submission-rest_cannot_access/) that mentions a plugin that causes this error.  Are you able to access the WP REST API for non-Civi data?  
  > **username_0**: Perhaps this gives some progress. I have tried the WP APi wrapper for Civi, v3. I got the following response.:  raise InvalidSchema("No connection adapters were found for {!r}".format(url)) requests.exceptions.InvalidSchema: No connection adapters were found for '"https://mdl.medborgerligsamling.se/wp-json/civicrm/v3/rest?key=site_key&api_key=apiKey&id=1795"'  Does this provide any further help. i'am really at a loss when it comes to these items. Thanks for helping out!  
  > **username_0**: I do not know if I can reach the WP Rest API for nonCivi data. I should have Administrator rights for the civi system but don't really know if it is ok for me to access the WP level.  
  > **username_0**: Jon, I have also worked a bit with curl so if that could help I could try to provide more info with your guidance.  
  
  ---
  
  