Skip to content

Instantly share code, notes, and snippets.

@thuutien
Last active September 19, 2023 14:42
Show Gist options
  • Save thuutien/fcdcc66b062e55573f4335aa4b384b8e to your computer and use it in GitHub Desktop.
Save thuutien/fcdcc66b062e55573f4335aa4b384b8e to your computer and use it in GitHub Desktop.
RestSharp API Call for NetSuite
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