General developer forum

API core_completion_get_course_completion_status returns cannotviewreport

 
Picture of Constantine Mars
API core_completion_get_course_completion_status returns cannotviewreport
 

API function core_completion_get_course_completion_status fails with error:


{

 "exception": "moodle_exception",

 "errorcode": "cannotviewreport",

 "message": "You cannot view this report"

}


Environment: https://demo.moodle.net/
Setup: 

  1. External services enabled, 
  2. Function added to service, 
  3. Token obtained. 
  4. User id and token when calling function belong to the same user (admin)
  5. Course id taken from one of the default courses


Could anyone please advise how to make core_completion_get_course_completion_status work?

 
Average of ratings: -
Picture of Rod Mcleay
Re: API core_completion_get_course_completion_status returns cannotviewreport
 

Did you find an answer to this?

I have the same problem.

 
Average of ratings: -
Picture of Luis Alejandro Soto Bedoya - Ceiba Software
Re: API core_completion_get_course_completion_status returns cannotviewreport
 
Hello, I have this same error, did you manage to find the solution?
 
Average of ratings: -
Picture of Murilo Baptista
Re: API core_completion_get_course_completion_status returns cannotviewreport
 

Hi, I actually had the same problem but then I found that my test course didn't have completion tracking enabled and completion conditions. Maybe you already found out but somebody else could have the same problem in the future. 

Thanks, Murilo.


 
Average of ratings: -