Forum Discussion

kxwillis's avatar
kxwillis
Regular Visitor
2 years ago

Invalid Auth Header from Web Activity for SalesForce

I am issuing a request to a SalesForce bulk API 2.0 from web activity but am receiving an INVALID_AUTH_HEADER resposne and am not sure why.  I do have a valid token from the previous web activity and am passing it in the header of this web activity.  Sample header from the configuration below.

 

{
"method": "GET",
"headers": {
"Authorization": "Bearer [token]",
"x-ms-date": "Mon, 20 May 2024 20:11:11 GMT",
"Content-Type": "application/json"
},
"relativeUrl": "/services/data/v51.0/sobjects/Account"
}

14 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi kxwillis ,

    Thanks for using Fabric Community.
    As part of debugging process, can you please test the rest api working perfectly with the help of postman?
    Identify the if the right URL is getting constructed, and debug from the response.
    If possible can you please share the screenshot of your issue. I would be able to guide you better if you can provide these details.

    • kxwillis's avatar
      kxwillis
      Regular Visitor

      Hello and thank you for your reply.  While working this request through Postman I received additional information the object I am intending to query may not be supported in a client credentials auth flow.  I am checking with SalesForce support on what items I need to enable to support query base objects using client credentials.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi kxwillis ,

        Thanks for the reply. Do let me know incase of further queries with Fabric.

  • kxwillis's avatar
    kxwillis
    Regular Visitor
    OUTPUT OF WEB ACTIVITY 1
    {
    "access_token": "00D5Y000001bchT!AQEAQDaYCiIjOZKYySRwnpsY3CloFGzEiTc0abZNK60LiEtqJWnRAvEHwrX363RTqbqwNz.[rest of token]",
    "signature": "KY58auRKT0Y4JdvVU/WRo6/WHvfqMoepYoHgm636nso=",
    "token_type": "Bearer",
    "issued_at": "1716566138903",
    "ResponseHeaders": {
    "Date": "Fri, 24 May 2024 15:55:38 GMT",
    "Set-Cookie": "CookieConsentPolicy=0:1; path=/; expires=Sat, 24-May-2025 15:55:38 GMT; Max-Age=31536000; secure;LSKey-c$CookieConsentPolicy=0:1; path=/; expires=Sat, 24-May-2025 15:55:38 GMT; Max-Age=31536000; secure;BrowserId=ENrFgBnmEe-_7qNw1875lg; domain=.salesforce.com; path=/; expires=Sat, 24-May-2025 15:55:38 GMT; Max-Age=31536000",
    "Strict-Transport-Security": "max-age=63072000; includeSubDomains",
    "X-Content-Type-Options": "nosniff",
    "X-Robots-Tag": "none",
    "Cache-Control": "no-store, must-revalidate, no-cache, max-age=0, private",
    "Vary": "Accept-Encoding",
    "Transfer-Encoding": "chunked",
    "Expires": "Thu, 01 Jan 1970 00:00:00 GMT",
    "Content-Type": "application/json; charset=UTF-8"
    },
    "executionDuration": 0
    }
     
    INPUT OF WEB ACTIVITY 2
    {
        "method": "POST",
        "headers": {
            "Authorization": "Bearer 00D5Y000001bchT!AQEAQDaYCiIjOZKYySRwnpsY3CloFGzEiTc0abZNK60LiEtqJWnRAvEHwrX363RTqbqwNz.[rest of token]",
            "Content-Type": "application/json",
            "Accept": "application/json"
        },
        "relativeUrl": "/services/data/v51.0/jobs/query",
        "body": {
            "operation": "query",
            "query": "SELECT Id FROM Account WHERE RecordType.Name <> 'Provider Account'"
        }
    }
     

     

  • smeetsh's avatar
    smeetsh
    Continued Contributor

    Does this thread help you perhaps? I myself struggled to find out how to send a bearer token to a copy action, which used a GET