Spartacus ASM giving 403 ForbiddenError while starting customer session - sap-commerce-cloud

Login with asagent in SPA- ASM
Search the customer (its returning the customer)
while starting the session it hits
https://localhost:9002/occ/v2/{basesiteid}/users/{userid}?lang=en&curr=abc its is giving
Request Method: GET
Status Code: 403
Response:
{
"errors" : [ {
"message" : "Access is denied",
"type" : "ForbiddenError"
} ]
}

in asagent ( Employee) add a group customermanagergroup ( Customer Manager Group ) this will solve the issue

Related

Azure assign group and device to script using Graph API

I am trying to assign groups and devices to a PowerShell script in Microsoft Intune using the following POST request:
URL: https://graph.microsoft.com/beta/deviceManagement/deviceManagementScripts/%7Bid%7D/Assign
Body:
{
"deviceManagementScriptGroupAssignments": [
{
"#odata.type": "#microsoft.graph.deviceManagementScriptGroupAssignment",
"id": "{ScriptId:GroupId}",
"targetGroupId": "{GroupId}"
}
],
"deviceManagementScriptAssignments": [
{
"#odata.type": "#microsoft.graph.deviceManagementScriptAssignment",
"id": "{ScriptID:DeviceID}",
"target": {
"#odata.type": "#microsoft.graph.allDevicesAssignmentTarget",
"deviceAndAppManagementAssignmentFilterId": null,
"deviceAndAppManagementAssignmentFilterType": "none"
}
}
]
}
However, I am getting a 400 error with the following message:
"{ "_version": 3, "Message": "An error has occurred - Operation ID (for customer support): 00000000-0000-0000-0000-000000000000 - Activity ID: 615c3437-bd99-2193-9d4b-d9a61deb0340 - Url: https://fef.amsua0102.manage.microsoft.com/DeviceFE/StatelessDeviceFEService/deviceManagement/deviceManagementScripts('{id}')/microsoft.management.services.api.assign?api-version=5022-11-08", "CustomApiErrorPhrase": "", "RetryAfter": null, "ErrorSourceService": "", "HttpHeaders": "{}"}"
I base on this document of Microsoft https://learn.microsoft.com/en-us/graph/api/intune-shared-devicemanagementscript-assign?view=graph-rest-beta
I tried to reproduce the same in my environment.
Received the same error:
{
"error": {
"code": "UnknownError",
"message": "{\"ErrorCode\":\"Forbidden\",\"Message\":\"{\\ \\\"_version\\\": 3,\\ \\\"Message\\\": \\\"An error has occurred - Operation ID (for customer support): xxxx –
}
When I followed the url in the error and queried, I got that the api version is not supported.
Make sure the authorization header is given with bearer token which has proper permissions to work with intune and device management
Omit the parameter #odata.type in the post request body.
{
"#odata.type": "#microsoft.graph.deviceManagementScript",
…
"runAs32Bit": true
}
Make sure you have DeviceManagementConfiguration.ReadWrite.All Application and delegated permissions.
Note that Intune requires an active Intune license for the tenant.

Expected OAuth 2 access token while importing VAPID Push subscriptions into Firebase

I am trying to import vapid push subscriptions into firebase. I found some solution in https://developers.google.com/instance-id/reference/server#import_push_subscriptions. It thew following error. Please help me regarding this.
POST : https://iid.googleapis.com/v1/web/iid
Headers :
Content-Type:application/json
Authorization:key=MY_SERVER_KEY
BODY:
{
"endpoint" : "https://fcm.googleapis.com/fcm/send/my_sub_key",
"keys" : {
"p256dh" : "hidden_key",
"auth" : "hidden_auth"
}
}
}
Response:
"error": { "code": 401, "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.", "status": "UNAUTHENTICATED" }

Netsuite Restlet - inserting sales order

I'm trying to insert in sales order through suitescript and I always get an error on 'Location'.
here's my request
{
"recordtype" : "salesorder",
"entity" : "142832",
"location" : {
"id":"395"
}
}
and this is the response
{
"error": {
"code": "USER_ERROR",
"message": "Please enter value(s) for: Location"
}
}
and I tried changing the location value for example
"location" : "390"
the result would be
{
"error": {
"code": "INVALID_KEY_OR_REF",
"message": "Invalid location reference key 390 for subsidiary <NULL>."
}
}
This error is occurring because the location is not "accessible" by the subsidiary associated with the customer. Subsidiaries are defined on the customer level, not on the sales order. You need to ensure the subsidiary chosen on the customer is contained within the subsidiary hierarchy of the location. To fix the issue you need to adjust the associated subsidiary of the location.
Here's more information on how to fix a very similar issue with items:
https://dashboard.suitesync.io/docs/resolving-errors#im-seeing-a-invalid-item-reference-key-123-for-subs

Create a new customer in the sandbox receive a 500 error. Google Reseller API v1

I have authenticated my request and when I'm trying to create a new customer in the sandbox, i receive a 500 error.
Request:
POST https://www.googleapis.com/apps/reseller/v1sandbox/customers
{
"customerDomain": "test.com",
"kind": "reseller#customer"
}
Response:
500 Internal Server Error
- Show headers -
{
"error": {
"code": 500,
"message": null
}
}
search the word "required" in this page
https://developers.google.com/admin-sdk/reseller/v1/reference/customers#resource

google Api adsense (401) Invalid Credentials

I have AdSense account with custom channels on it I make every thing but there are two problems:
I get reports for all account i need to get reports for one channel
based on channel id
I need to get reports for all users without they have my google to
access whene i save my details in database
My data:
{
"access_token" : "XXXX.XXXX",
"token_type" : "XXXX",
"expires_in" : XXXX,
"created" : XXXX
}
My update statements:
$access_token_update = json_decode($access_token);
$access_token_update->created = time();
I'm getting this error message:
(401) Invalid Credentials
My code:
$client->setClientId($client_id);
$client->setClientSecret($client_secret);
$client->setAccessType('offline');
$client->setAccessToken($access_token);
$service= new Google_Service_AdSense($client);
do steps in this video
https://www.youtube.com/watch?v=hfWe1gPCnzc
save code from results example
{
"access_token": "XXXXXXXX",
"token_type": "XXXX",
"expires_in": XXXX,
"refresh_token": "XXXXXXXXX"
}
then update your file as the following
$access_token = "from database or file or what you want to save"; // this will be code you got by doing steps in this video.
$client->setClientId($client_id);
$client->setClientSecret($client_secret);
$client->setAccessType('offline');
$access_token_json = json_decode($access_token);
$client->refreshToken($access_token_json ->refresh_token);
$service= new Google_Service_AdSense($client);
enjoy :) thanks

Resources