2

I am trying to access edx course information into my iOS app. Preferably, I'd like to a user to access the list of courses they are taking.

When I make the GET request, my data reads:

{

detail = "Authentication credentials were not provided.";

}

Here is my code:

import UIKit
import Alamofire

let kEdxResourceURL = "http://mobile3.m.sandbox.edx.org/"

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        Alamofire.request(.GET, kEdxResourceURL + "api/mobile/v0.5/users/wedu/course_enrollments/").responseJSON() {
        (_, _, data, _) in
            println(data!)
        }
    }
}
vikzilla
  • 3,998
  • 6
  • 36
  • 57
  • It says you have to pass authentication credentials for that particular user to get it's enrolled courses. – Jay Modi Sep 01 '15 at 06:46

1 Answers1

0

Even though mobile v0.5 is deprecated, Let me copy this from Open edX API development guide.

EdX API Authentication OAuth 2.0 The edX Platform APIs use OAuth 2.0 for authentication. OAuth 2.0 is an open standard used by many systems that require secure user authentication. See the OAuth 2.0 Standard for more information. Registering with Your Open edX Instance

To use the edX Platform API with courses on your instance of Open edX, you must register your application with the Open edX server. See the OAuth 2.0 specification for details.

http://edx.readthedocs.io/projects/edx-platform-api/en/latest/authentication.html

Isanka Wijerathne
  • 3,746
  • 3
  • 26
  • 34