Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I'm trying to build an Automation to connect to the MYOB accounting package and pull information back for reporting. I run into two problems.
First is authentication. When I specify any scope other than "CompanyFile", like so:
Then when I try to link connection, I get an error:
{"errors":[{"code":"AUT-006","title":"Invalid Request","detail":"Exception: failed to receive a valid OAuth code.","meta":{"message":"array (\n 'error' => 'invalid_scope',\n 'error_description' => 'The requested scope is invalid, unknown, or malformed. The OAuth 2.0 Client is not allowed to request scope \\'sme-general-ledger\\'.',\n 'state' => 'iNbrl1ZRbvFo8twVfQBY2xlQ',\n)"}}]}And the URL in the auth box is:
https://abcis.ap.qlikcloud.com/api/v1/automations/connections/c0994181-d123-4bb1-b4ff-5d5277f3f725/actions/callback?error=invalid_scope&error_description=The%20requested%20scope%20is%20invalid%2C%20unknown%2C%20or%20malformed.%20The%20OAuth%202.0%20Client%20is%20not%20allowed%20to%20request%20scope%20%27sme-general-ledger%27.&state=YQEdux56bmv29X4pqYkvBEXSThis looks like rather than sending the query parameter as " &scope=sme-general-ledger ", it's sending as " &scope='sme-general-ledger' ", which is not valid for MYOB.
How do I prevent this quote wrapping?
Second, there is a problem with base addresses. MYOB actually uses multiple base addresses: "api.myob.com" for basic API info, and different servers like "arl2.api.myob.com" to get data from the specific company files. OAuth connectors can't accept a variable into the base_url, and neither can I leave the base_url blank and fill in the entire URL in the individual blocks. How do I manage this? Will I need to have two separate Connections (and thus, need to have our client auth twice)?
@JBH_ABCis e-zpassvawrote:
Hi everyone,
I'm trying to build an Automation to connect to the MYOB accounting package and pull information back for reporting. I run into two problems.
First is authentication. When I specify any scope other than "CompanyFile", like so:
Then when I try to link connection, I get an error:
{"errors":[{"code":"AUT-006","title":"Invalid Request","detail":"Exception: failed to receive a valid OAuth code.","meta":{"message":"array (\n 'error' => 'invalid_scope',\n 'error_description' => 'The requested scope is invalid, unknown, or malformed. The OAuth 2.0 Client is not allowed to request scope \\'sme-general-ledger\\'.',\n 'state' => 'iNbrl1ZRbvFo8twVfQBY2xlQ',\n)"}}]}And the URL in the auth box is:
https://abcis.ap.qlikcloud.com/api/v1/automations/connections/c0994181-d123-4bb1-b4ff-5d5277f3f725/actions/callback?error=invalid_scope&error_description=The%20requested%20scope%20is%20invalid%2C%20unknown%2C%20or%20malformed.%20The%20OAuth%202.0%20Client%20is%20not%20allowed%20to%20request%20scope%20%27sme-general-ledger%27.&state=YQEdux56bmv29X4pqYkvBEXSThis looks like rather than sending the query parameter as " &scope=sme-general-ledger ", it's sending as " &scope='sme-general-ledger' ", which is not valid for MYOB.
How do I prevent this quote wrapping?
Second, there is a problem with base addresses. MYOB actually uses multiple base addresses: "api.myob.com" for basic API info, and different servers like "arl2.api.myob.com" to get data from the specific company files. OAuth connectors can't accept a variable into the base_url, and neither can I leave the base_url blank and fill in the entire URL in the individual blocks. How do I manage this? Will I need to have two separate Connections (and thus, need to have our client auth twice)?
Your authentication error is likely caused by the Qlik Automation OAuth connector **single-quote wrapping** the `sme-general-ledger` scope, which MYOB's API rejects. To fix this, try bypassing the connector's dedicated scope field and instead manually append the scope (e.g., `&scope=sme-general-ledger`) directly to the **Authorize URL** field. For the multiple base address issue (`api.myob.com` vs. `arl2.api.myob.com`), define the single connection with the generic `https://api.myob.com` base. Then, in your automation, use the **Raw API Request** block; for company file data, provide the **full, company-specific URI** (obtained from the discovery call) in the Path field. This full URI will override the connection's base URL while still using the single, required OAuth token, thus avoiding double authentication.