Jump to content

Customer Centric

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by Customer Centric

  1. On 12/2/2021 at 9:05 AM, Steel, Mark said:

    Hi Leo

    Thanks for the request. Have you been able to use the access_token returned in POSTMAN to make the same request?

    It appears that it is the format of the request that is incorrect. You'll need to ensure you're setting the authorization type as Bearer when sending the access_token in the header. 

    Let me know how you get on.

    Thanks

    Mark

    Thanks Mark, was sending the token without the 'Bearer' before the Token. Thanks for your support. 

     

     

  2. Hi Mark, sure!

    It's python though:

     

    def contact():
                  token_info = session.get('TOKEN_INFO')
                  r = requests.get(url_query_business, headers= {'Authorization': token_info})
                  data = r.json()
                        return render_template('Contact.html', data=data) 

    url_query_business = 'https://api.accounting.sage.com/v3.1/businesses/lead'

     

    ## The header only includes the token. 

     

    Thanks for any light you can share with me.

    Thanks,

    Leo

     

     

  3. Hi Mark,

                        I'm having similar error:

    I'm getting the authorization code, trading with the token code. Then, doing a get request with the token received before and getting the error below: 

     

    [{'$severity': 'error', '$dataCode': 'BadRequest', '$message': 'Authorization header has incorrect format', '$source': ''}]

     

     

    def contact():
                            
                  token_info = session.get('TOKEN_INFO')
                  r = requests.get(url_query_business, headers= {'Authorization': token_info})
                  data = r.json()
                           

                         return render_template('Contact.html', data=data) 
     

    Any idea? I'm a little stuck here. Thanks

     

     

     

     

×
×
  • Create New...