本文介绍了如何在ColdFusion 9中签署quickbooks在线API请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的CF应用中,我使用了位于riaforge的获取请求令牌和访问权限令牌从QuickBooks在线和它工作正常。
在我试图通过开始构建调用的http头部来进行QBO API调用(我按照HTTP授权头一节的说明:)。然后根据riaforge的代码的方法构建http头,因为它工作。此外,我已遵守Intuit 在上一个链接中给出的参数的顺序)。

In my CF app, I've used the CF OAuth code at riaforge to get request token and access token from QuickBooks Online and it works fine.After I tried to make a QBO API call by starting to build the http headers of the call (I followed the instructions on the section "HTTP Authorization Header" here: Implement OAuth in Your App). Then built the http header based on the methods of the code at riaforge because it worked. In addition, I've respected the order of the parameters given by Intuit in the previous link).

当我启动API调用时,我收到了回复:signature_invalid

When I launched the API Call, I received the response: "signature_invalid"

如果我已准备好6个头参数,如何签名QBO在线API调用CF 9:

I really want directions on how to sign the QBO online API Call with CF 9 if I have ready the 6 header parameters:


  • oauth_token

  • oauth_nonce

  • oauth_consumer_key

  • oauth_signature_method

  • oauth_timestamp

  • oauth_version

  • oauth_token
  • oauth_nonce
  • oauth_consumer_key
  • oauth_signature_method
  • oauth_timestamp
  • oauth_version

(但如果可能,工作代码会更好)

(But if possible a working code would be better)

提前感谢您的时间和帮助

Thank you in advance for your time and help

推荐答案

这是我用于生成请求的签名和头令牌,简单的添加用于您需要的其他签名。

this is what I use for generating the signature and header for the request token, simple additions are used for the other signatures you'll need along the way.

paramsStr = "oauth_callback=" & encodeData(CALL_BACK_URL) & "&" & "oauth_consumer_key=" & sConsumerKey & "&" & "oauth_nonce=" & session.nonce & "&" & "oauth_signature_method=" & SIGNMETHOD & "&" & "oauth_timestamp=" & TIMESTAMP & "&" & "oauth_version=" & VERSION;

signStr = "POST&" & encodeData(REQUEST_TOKEN_URL) & "&" & encodeData(paramsStr);

signature = computeHMACSignature(signStr, sConsumerSecret & "&");

authHeader = 'OAuth ' & createHeaderElement("oauth_consumer_key", trim(sConsumerKey)) & ", " & createHeaderElement("oauth_nonce", trim(session.nonce)) & ","  & createHeaderElement("oauth_signature_method", trim(signmethod)) & ", " & createHeaderElement("oauth_signature", trim(signature)) & ", " & createHeaderElement("oauth_timestamp", trim(TIMESTAMP)) & ", " & createHeaderElement("oauth_version", trim(VERSION)) & ", " & createHeaderElement("oauth_callback", trim(CALL_BACK_URL));

这篇关于如何在ColdFusion 9中签署quickbooks在线API请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 17:41
查看更多