I have successfully setup my oAuth2 flow, created a Connected App and I can retrieve an access_token and instance_url just fine. Now that I have those two pieces of data, how can I perform SOQL queries in C#?
Currently my code is:
var client = new SforceService(); client.Url = instanceUrl; client.SessionHeaderValue = new SessionHeader(); client.SessionHeaderValue.sessionId = accessToken; client.query($"SELECT Id FROM Attachment");
However when the client.query() function gets hit, Salesforce returns the login page instead of the expected rows, even though I already granted access to my Connected App for that user and successfully retrieved the access_token
Is there another way I should be performing the query? Is there another piece of data I need to provide the SforceService() object?