-
Notifications
You must be signed in to change notification settings - Fork 54
Description
@myob_client ||= Myob::Api::Client.new({
:consumer => {
:key => "h7hzzjk9m66y5f2gbqz568x8",
:secret => "teREHZ8SFvuWsW9ZMd5W6qcT",
},
redirect_uri: "https://dev-api.geo.ventures/api/v1/myob/auth/callback",
})
@myob.client.get_access_code_url
=> "https://secure.myob.com/oauth2/account/authorize?client_id=h7hzzjk9m66y5f2gbqz568x8&redirect_uri=https%3A%2F%2Fdev-api.geo.ventures%2Fapi%2Fv1%2Fmyob%2Fauth%2Fcallback&response_type=code&scope=CompanyFile"
then when i tried getting the access token using this ( i got the code from the get_access_code_url then i typed it manually (for test purpose))
@myob_client.get_access_token("lVxf!IAAAAM1aRlX_W-4pHwXiPzjhcse2fTvkh8-pYde3bDKAkamZAQEAAAGVDCeKdT8c2PtMHGpMrJZKFyKmAXdzTgpO0-gUtV0KQX5_khEnV-kw63JkwQ8x49CJj6cluXhBXx2Dz21WN7W28Fj_OyXeNNKPaO8IGAxlVjra9bHbw7OKTGU75m2CEks75kjhy1SSI1hwvzMz-OS3oO8P8gez8O1-6GL4DJlKaPjDLIdzBOFNL7O3uIn3UgXVk-8sweLiBDJZQO7D6bcLwGTM0pVoyOct-l2jfoSTBmGVK3dispjna0jjFChgyULb8ji2-AwvmgHnpAPhsDrwpGQdBSBSndEmwGOh8D6HjAVRX41ucSi_dvOurSNK04UnUpZKpLG__a_DGcgjHSRI")
it shows
OAuth2::Error: invalid_request:
{"error":"invalid_request"}
from /var/lib/gems/2.3.0/gems/oauth2-1.4.1/lib/oauth2/client.rb:119:in `request'
[24] pry(main)> @myob_client.company_file.all
OAuth2::Error: :
{
"Errors": [
{
"Name": "OAuthTokenIsMissing",
"Message": "The supplied OAuth token is missing",
"AdditionalDetails": "Header",
"ErrorCode": 31002,
"Severity": "Error",
"LearnMore": null
}
],
"Information": "Warning, error messages have not been finalised in this release and may change"
}