mike4aday / SwiftlySalesforce

The Swift-est way to build native mobile apps that connect to Salesforce.
MIT License
136 stars 43 forks source link

Error 403 #109

Closed DanielsCode closed 4 years ago

DanielsCode commented 4 years ago

Hi,

I tried to setup my first Swiftly Salesforce application. I am not able to fetch any account data - I tried the example code. Instead of receiving the data of the record I get these message:

SwiftlySalesforce.Salesforce.Error.resourceError(httpStatusCode: 403, errorCode: nil, message: Optional("Salesforce resource error."), fields: nil)

I thought this is related to the setting of the connect app. I check the value, I granted the oauth permission: refresh_token, api and web. Did I forget something? Or are there still ideas why I don't receive any data?

looking forward to get any feedback. Cheers, Daniel

mike4aday commented 4 years ago

@DanielsCode which method(s) are you calling? Do you get the same error with other methods?

DanielsCode commented 4 years ago

@mike4aday I tried this one:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        salesforce = try! Salesforce(consumerKey: consumerKey, callbackURL: callbackURL)
        salesforce.retrieve(type: "Account", id: "0011t000006FIEuAAO").done { (queryResult: QueryResult<SObject>) -> () in
            for record: SObject in queryResult.records {
                // Do something more interesting with each record
                debugPrint(record.type)
            }
        }.catch { (error: Error) in
            // Do something with the error
            debugPrint(error)
        }
        return true
    }

We are using: Salesforce - Essentials Edition - is this a problem?

mike4aday commented 4 years ago

@DanielsCode - yes, the edition is the issue. The Salesforce API is not available to Essential Edition users. See https://help.salesforce.com/articleView?id=000326486&type=1&mode=1