Moodle [errorcode] => errorcoursecontextnotvalid - moodle

Hi while connecting Edwise Bridge to moodle i am getting this error:
An issue is detected.
Status :
Connection Failed
URL:
https://fxcursos.entendiendoforex.com//webservice/rest/server.php?wstoken=38546d8b79c6a1b150fb13b6f0e36a76&wsfunction=core_course_get_courses&moodlewsrestformat=json
Response :
stdClass Object ( [exception] => moodle_exception [errorcode] => errorcoursecontextnotvalid [message] => You cannot execute functions in the course context (course id:1). The context error message was: error/forcepasswordchangenotice )
Can anyone help me with this?

I found it. The problem is Force Password Change is activated. I have gone inside the user account & unchecked the Force Password Change checkbox, after performing this change I am able to test the Moodle connection.

Related

Google Analytics Error code 403 Insufficient Permission Perl

before posting I make sure to check other similar threads.
but none has the same problem as mine.
the closest two would be:
Google Analytics PHP API "(403) Insufficient Permission"
and Google Analytics API - inconsistent error "insufficientPermissions' (403)
but there is no specific answer/solution to that thread.
and found this Python Google Analytics Management API throws error 403 Forbidden but I dont really know/understand if this is related to my issue..perhaps someone can enlighten me?
I have 2 clients, A & B. Both claimed has granted me the access to Read & Analyse
I succeed extracting data from A, but failed on B.
I believe, I have both GA Profile ID correct and no coding error (since A succeed).
To confirm that I dont use wrong GA profile ID, GA Profile ID would be 9876543 from the example below
/a12345w654321p9876543/
The error code is 403, insufficient permission for this profile.
GA error: 403 Forbidden {"error":{"errors":[{"domain":"global","reason":"insufficientPermissions","message":"User does not have sufficient permissions for this profile."}],"code":403,"message":"User does not have sufficient permissions for this profile."}} at ./ga_pp_yest.pl line 90.
Then, I tried to give access to the same account on my own website (for testing purpose).
I go to Property level and give permission Read & Analyse. (even tried changing to Account Level with Edit permission)
I still get the same error.
some of my code:
my $analytics = Net::Google::Analytics->new;
# Authenticate
my $oauth = Net::Google::Analytics::OAuth2->new(
client_id => $client_id,
client_secret => $client_secret,
);
my $token = $oauth->refresh_access_token($refresh_token);
$analytics->token($token);
$req = $analytics->new_request(
start_date => "$startDate",
end_date => "$startDate",
ids => "ga:$profile_id",
dimensions => "ga:pagePath,ga:date,ga:hour,ga:channelGrouping,ga:deviceCategory,ga:region,ga:city",
metrics => "ga:entrances",
max_results => "1000",
);
$res = $analytics->retrieve($req);
die( "GA error: " . $res->error_message ) if !$res->is_success;
I checked the token, it gave me 1 hour of access. using this link https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=accessToken
any help is greatly appreciated.
thank you very much

SMSA Tracking status [duplicate]

I'm making my first attempt to connect to a SOAP server from PHP, and I'm not understanding how to log in and get the data I need. The service I'm trying to connect to is the Hawley USA service http://hawleyusa.com/thcServices/StoreServices.asmx). I've been looking at a few posts on how to connect, and I get the basics. I've verified that I have SOAP enabled in my PHP, and I'm just trying to get an inventory list. Here's the code I'm using:
<?php
ini_set("soap.wsdl_cache_enabled", "0"); // disabling WSDL cache
$wsdl_path = "http://hawleyusa.com/thcServices/StoreServices.asmx?WSDL";
$login_id = 'mylogin_id';
$password = 'mypassword';
$client = new SoapClient($wsdl_path);
try {
echo "<pre>\n";
print($client->InventoryList(array("LoginID" => $login_id, "Password" => $password)));
echo "\n";
}
catch (SoapFault $exception) {
echo $exception;
}
However, when I run this code, I get this error:
SoapFault exception: [soap:Server] Server was unable to process request. ---> Object reference not set to an instance of an object. in /Users/steve/Sites/mysite/hawley_client.php:12
When debugging, I can see the $client instance initiated, so I'm not sure why I'm getting this error.
Second question: Am I passing the user ID and password correctly?
Thanks.
Update: I threw in $client->__getLastRequest, and this is what I got:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://hawleyusa.com/thcServices/">
<SOAP-ENV:Body>
<ns1:InventoryList/>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
So I can see that I'm missing my login ID and password. How do I add them to my InventoryList call?
You're close. Looking at the WSDL the InventoryList method takes an object called "request". Modify your call line slightly:
$client->InventoryList(array("request" => array("LoginId" => $login_id, "Password" => $password));
Probably it's not the same case but it also gives the same error if you don't specify empty strings in fields you don't need to use, taken from http://www.sitepoint.com/forums/showthread.php?755549-SOAP-XML-Object-reference-not-set-to-an-instance-of-an-object
I my case the problem was in typo:
In given docs the filed name was documentShipmentAddress (and I was using this)
but in wdsl (schema) was:
shipmentAddress
So that could be the problem with this error message.
I have changed the field name to shipmentAddress and it solved the problem.

Paypal Adeptive Response Message

can anyone please explain me this error message?
i am using paypal adeptive payments but all is properly setup but this error is coming in light box pop up so please explain it for me?
Array
(
[Errors] => Array
(
[0] => Array
(
[Receiver] =>
[Category] => Application
[Domain] => PLATFORM
[ErrorID] => 520003
[ExceptionID] =>
[Message] => Authentication failed. API credentials are incorrect.
[Parameter] =>
[Severity] => Error
[Subdomain] => Application
)
)
)
thank you
This error message is the result of incorrect credentials being passed. You would want to make sure the credentials you are passing are correct. Note, if you are copying them from the PayPal website directly, I would recommend copy and pasting them into a text editor then copy and paste from there to your code to avoid leading or trailing spaces from occurring when pasting the information.
If your credentials are correct I would recommend reviewing your code to ensure that these credentials are not being changed or modified when being passed over to PayPal.
One thing thing you can try is if your using the sandbox for the purpose of this testing, I would recommend attempting to run it in Live mode as there can be issues occasionally with certain functions running on the sandbox environment.

GraphMethodException - Unsupported get request at

I have two Debian-systems. With both I access the Facebook-API via Perl(Facebook::Graph).
On the first system this works perfectly, on the other system I ran into following problem.
Could not execute request (https://graph.facebook.com): GraphMethodException - Unsupported get request at /usr/local/share/perl/5.10.1/Facebook/Graph/Response.pm line 40
Response.pm:
[...]
has response => (
is => 'rw',
isa => 'HTTP::Response',
required=> 1,
);
[...]
ouch $response->code, 'Could not execute request ('.$response->request->uri->as_string.'): '.$message, $response->request->uri->as_string;
[...]
I know it has something to do with my ssl-libs, but I cannot figure out where the problem is. I reinstalled multiple times the IO:Socket:SSL and SSLeay.
Every help is welcome,
enzo
Don't know if this helps, but came on here looking for help with 'graphMethodException' when trying to access this page: http://graph.facebook.com/doodleembroidery (which works fine now).
Have just tracked it down to the page's country permissions. She didn't realise she had set restrictions when she created the page, now she's removed them the link works fine!

Errors with: https://graph.facebook.com/app_id/insights/share_views/day?access_token=

I am trying to get the number of users who have seen pages shared from my site using: https://graph.facebook.com/app_id/insights/share_views/day?access_token=
I am filling in my app_id and access_token and I am getting an error response of:
Array ( [error] => Array ( [type] => OAuthException [message] => (#604) Invalid metric name: share_views ) )
Has anyone run into this error and determined the cause?
I believe you need to actually specify time period you are trying to access. For an example of an application that is working and can access Insight data, check here https://github.com/facebook/insights-api-sample.
Notice that they specify a since and until post parameter in this file:
https://github.com/facebook/insights-api-sample/blob/master/php/results.php