Opencart create custom admin api - rest

I have created a custom REST api to call the order api and get the order details, but it is redirecting me again to login page when I calling the api from browser and it throws error "Permission Denied". How to resolve it?

Related

Trying to access the account (Preview) REST API in Keycloak , getting a 404

I am trying to access the new account API (Not the Admin) in keycloak 4.8.3 . I am trying to do :
GET "/auth/realms/{realm}/account/credentials/password" endpoint (Based on the AccountRestServiceTest.java)
with the account owner's token. Getting a 404 error.
I have started the sever with preview features
bin/standalone.bat -Dkeycloak.profile=preview
I have tried to add profile.properites file with profile=preview options
and the user has "manage-account","view-profile" account roles
What am i doing wrong here?
I'm facing the same problem and i found a solution.
You need to add the HTTP header Accept with the value application/json to your request.
Because AccountRestService is only accessible if headers Accept or Content-Type are application/json.

Error Implementing Acumatica REST API

I am currently trying to implement the use of the Acumatica REST APIs in a project I am working on. I am able to successfully log in to the application.
The issue is when I try to access additional data, customers for example, I receive the following message: {"message": "You have been logged out because your account has been disabled. Please contact your system administrator."} in the form of a 403 error.
I checked my account permissions and I do have the System Admin Role on the account I am using to log in to Acumatica. Below is a screen shot of my postman.
You probably have the admin user disabled.
Some function of Acumatica impersonate the admin user in order to complete their task. Some of these functionalities include the web services, the scheduler and the integration services.
Enabling the admin user should fix the issue you are facing.

Getting 500 error when trying to create site using SharePoint rest API

I am using SharePoint rest API as given in their documentation to create site. We are using client credentials grant flow for authorisation. We are using Global Admin to grant access to our app. It works fine for some tenants but for some tenants its giving 500 error with empty exception message.
Request :
Method - Post
url - "http://<site url>/_api/web/webs/add"
headers -
"Authorization": 'Bearer ' + access_token
"content-type" : "application/json;odata=verbose"
For some tenants it is creating site properly but for some tenants its giving this error.
Status Code: 500
Error: {u'error': {u'message': {u'lang': u'en-US', u'value': u''}, u'code': u'-2146232060, Microsoft.SharePoint.SPException'}}
So my question is are there any other parameters or permissions for global admin in SharePoint online which are required to create a site as we are using global admin for authorisation?
And since there is empty error message does this error code "-2146232060" gives some additional information which can help me in debugging this?
Edit ****
Checking other answers for 500 error which tells to check for updated value of form digest. In this case i am using oauth flow so i am not using form digest.
You get this error when you try to create a o365 group(modern sites) under some classic sites eg.Team sites using REST API.

Atlassian STASH REST API 401

I'm trying to use the Stash REST API in order to get a list of all open pull requests using the URI https://stash.myserver.com/stash/rest/api/1.0/projects/TEST/repos/testrepo
But I always get a 401 Unauthorized with the following content:
{"errors":[{"context":null,"message":"You are not permitted to access this resource","exceptionName":"com.atlassian.stash.exception.AuthorisationException"}]}
I use HTTP Basic Auth and the user definitely has proper permission to the repository. It also works if I open the REST URL in the browser while I'm logged in or when I use the JSESSIONID-Cookie.
Is it possible that I need to enable basic auth in Stash? I couldn't find such an option in the admin settings.

Loopback and passport - AccessToken 401 Permission denied

I'm trying to see how to use loopback-passport. So I clone this repo: loopback-example-passport and got it working with Facebook and local login. However, if I go to the API explorer and try to GET some users, or my own accessToken, I always get 401-permision denied.
What I am doing is this:
Open up the example application
Log in using Facebook Provider
Get the token stored in local-storage and set it in the API explorer
Make a request
So in the API explorer I'm using the same access token I got from the Facebook provider. What I'm I doing wrong here?
Thanks!