ディスカッション
NetSuiteの保存検索やレポートをマスターするための究極のガイドである分析センターを使用して、データの力を最大限に活用しましょう。複雑さを単純化し、組織の真の可能性を解き放ちます。今すぐ分析センターに参加して、新たな高みを目指しましょう!
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Update: Narrative Insights has been restored and is now available.
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.
NLAuthを使用してRESTletにてGETリクエストを送信するサンプルRubyコード
適用
製品: NetSuite 2021.1
シナリオ
ユーザは、Rubyを使用してRESTLetからGETリクエストを実行したいと考えています。これを実現するためには、RESTクライアントgemを使用する必要があります。
解決策
Rubyを使用したサンプルスクリプト:
require 'rest_client' get_url = 'https://rest.na1.netsuite.com/app/site/hosting/restlet.nl? script=34&deploy=1&recordtype=customer&id=205' account_id = 'ACCT123456' email = 'youremail@netsuite.com' password = 'thepassword' role_id = '3' auth_header = 'NLAuth nlauth_account=' + account_id + "," auth_header += "nlauth_email=" + email + "," auth_header += "nlauth_signature=" + password + "," auth_header += "nlauth_role=" + role_id myheader = Hash.new myheader["Authorization"] = auth_header myheader["Content-Type"] = "application/json" response = RestClient.get(get_url, myheader) puts response.to_str
このサンプルでは、以下を使用することができます。
response = RestClient.get(get_url, {:Authorization => auth_header, :content_type => :json})
または
response = RestClient.get get_url, {:Authorization => auth_header, :content_type => :json}
for line 19
タグ付けされた:
0