How to get about book information

Joe_10453072
Joe_10453072 Member Posts: 17
edited September 2020 in Accounts Hosted
Hello

I am investigating Reckon Account Hosted API using Postman.
I am able to understand and implement by PHP regarding Authentication such as get token by authentication code or refresh token.
However, I couldn't proceed for next step because I couldn't get book value which is required almost every api via Postman. E.g. "{{url}}/{{book}}/companyinfo" according to Postman.

How can I get this value from anywhere?


Comments

  • Jason Hollis
    Jason Hollis Alumni Posts: 516 Reckon Staff
    edited September 2020
    Hi Joe. You are looking at the Reckon One endpoints (see R1 collection noted in postman). Reckon Accounts Hosted is a completely different product / API. Please follow the API docs menu to that product. Regards, Jason. 
  • Joe_10453072
    Joe_10453072 Member Posts: 17
    edited September 2020
    Hello Jason

    Thank you for your reply
    I could proceed to next step.
    However, I have a question regarding authentication for company file access.
    Let me know if you can answer it.

    The company file its password is blank.



    1. I'd got a postman collection for RHA correctly.

    2. I'd set up configuration on Postman.

    2-1. I'd set up the authentication for host access like here:





    3. I've successfully accessed regarding authentication:

    3. I've successfully accessed some kinds of API such as "Supported Versions".

    4. I've unsucessfully accessed some kinds of API. They responded:

    {
        "Message": "Error accessing your Reckon Accounts company file. The user account used to connect is either logged in to your company file already, or the username or password details are wrong. Please resolve before trying again."
    }
    How should I investigate for this issue. Could you give me any advise, please?

    Thanks
  • Jason Hollis
    Jason Hollis Alumni Posts: 516 Reckon Staff
    edited February 2020
    Hosted has 2 auth processes.
    1. User access to the API/hosted environment. Thats your 123456-1 format login. 
    2. The QBW file (company file) username and password. 
    You'll see in the help docs that we recommend creating a new user for the API, however if you are using the ADMIN (NEVER do this on a live client file) then:
    1. make sure you give the admin a password (and use that in your payload).
    2. make sure you have logged out of the company file first (under the product file menu). ** The API can't use the same company file user you are logged into the company file with. 
    However...
    So you don't need to log out all of the time, I would create that second company file user (see the docs), then switch the file (whilst logged in as Admin) to multi-user mode. You should now be able to use the API whilst remaining logged in as the Company File admin. 

    Remember... the company file username and password needs to be in your payload, so change that from Admin. eg Username = API, password = 123456?
  • Joe_10453072
    Joe_10453072 Member Posts: 17
    edited February 2020
    Hi Jason
    Thank you for your reply, and sorry I'm late to reply.

    At the moment, I might proceed to next step. The reason of this issue was single user mode maybe.
    However, I've faced another error "500 Internal Server Error".

    For Company Query Request, according to Postman,

    Request header is:
    Authorization: Bearer <TOKEN>
    Content-Type: application/json
    User-Agent: PostmanRuntime/7.22.0
    Accept: */*
    Cache-Control: no-cache
    Postman-Token: <POSTMAN_TOKEN>
    Host: api.reckon.com
    Accept-Encoding: gzip, deflate, br
    Content-Length: 288
    Cookie: ...
    Connection: keep-alive
    Request Body is:
    {
    "FileName":"Q:\Test.QBW", "Operation":"<?xml version="1.0\""?>
      <?qbxml version=\""6.1\""?>
      <QBXML> <QBXMLMsgsRq onError=\""continueOnError\""> <CompanyQueryRq /> </QBXMLMsgsRq>
    </QBXML>"",
    ""UserName"":""api"",
    ""Password"":""<PASSWORD>"",
    ""CountryVersion"": ""2019.R1.NZ""
    }
    Response header is:
    Date: Thu, 06 Feb 2020 21:20:04 GMT Content-Type: text/html; charset=utf-8 Transfer-Encoding: chunked Connection: keep-alive Set-Cookie: AWSALB=<AWSALB>; Expires=Thu, 13 Feb 2020 21:20:04 GMT; Path=/ Set-Cookie: AWSALBCORS=<AWSALBCORS>; Expires=Thu, 13 Feb 2020 21:20:04 GMT; Path=/; SameSite=None; Secure Server: nginx/1.14.1 Access-Control-Allow-Origin: * Vary: Accept ETag: <ETAG> x-powered-by: ASP.NET
    Response body is empty.

    Could you give me any advice, please?
    I suppose authentication for the host and company is successful.
    ?
    Thanks"
  • Ifti
    Ifti Reckon Staff Posts: 258 Reckon Staff
    edited February 2020
    Hi Joe,

    This seems to be because you've passed only one slash in the FileName object and it' getting rejected.

    You need to escape the slash by adding another slash. So the FileName should be: 
    "FileName":"Q:\Test.QBW",


    Please give that a try and let us know how you go.

    Thanks
    Ifti

  • Joe_10453072
    Joe_10453072 Member Posts: 17
    edited February 2020
    Hello  Ifti
    Thank you for your reply.
    yes, you're right.

    I tought I already tested double backslashes. But I didn't yet...
    Now, I got company information via API.

    Thanks again!