Last active
September 19, 2023 14:42
-
-
Save thuutien/fcdcc66b062e55573f4335aa4b384b8e to your computer and use it in GitHub Desktop.
RestSharp API Call for NetSuite
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static async Task getData() | |
{ | |
var oAuth1 = OAuth1Authenticator.ForAccessToken( | |
consumerKey: CONSUMER_KEY, | |
consumerSecret: CONSUMBER_SECRET, | |
token: TOKEN_ID, | |
tokenSecret: TOKEN_SECRET, | |
OAuthSignatureMethod.HmacSha256 | |
); | |
oAuth1.Realm = ACCT_ID; | |
var options = new RestClientOptions("base url here") | |
{ | |
Authenticator = oAuth1 | |
}; | |
var client = new RestClient(options); | |
var request = new RestRequest("Full request url here", Method.Get); | |
var response = await client.ExecuteAsync(request); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment