Skip to main content
replaced http://salesforce.stackexchange.com/ with https://salesforce.stackexchange.com/
Source Link

I confirm Daniel Ballinger's solutionDaniel Ballinger's solution on this page.

The scope needed for the OAuth token is "web: Provide access to your data via the Web (web)". According to the Salesforce documentation on Scope Parameter Values, this "Allows the ability to use the access_token on the Web" which I presume means using the Access Token as a cookie?

Steps to download a Rich Text Area (RTA) image via OAuth and curl, or similar programmatic methods:

  1. Make sure you have the correct scope for your OAuth access token. Go to the "Connected Apps" page for your OAuth connected app in Salesforce. Under "API (Enable OAuth Settings)" make sure the scope "web: Provide access to your data via the Web (web)" is included.

  2. If you were using an old refresh token with the old scope, re-authorize and get a new one with the new scope which includes "web".

  3. Get the URL of the RTA image by browsing the Knowledge article and inspecting the image src URL in your browser. The URL should look like

    https://example--c.eu3.content.force.com/servlet/rtaImage?eid=ka0w0000000U2CV&feoid=00Nw0000008eLoi&refid=0EMw00000004lzh
    
  4. Make a curl request setting your cookie "sid" to the OAuth access token value e.g.

    curl -ik --cookie 'sid=MyOauthAccessToken' 'https://example--c.eu3.content.force.com/servlet/rtaImage?eid=ka0w0000000U2CV&feoid=00Nw0000008eLoi&refid=0EMw00000004lzh'
    
  5. The request will return a 302 redirect. Do another curl with the redirect URL and set the same "sid" cookie value. Follow 3-4 subsequent redirects, using the returned redirect URL each time, until the response header includes a "Set-Cookie" giving you a new "sid" cookie value.

    Set-Cookie: sid=0023457000079pu!AR8AQO8byIe2NtMi8vd3bt5vVBFqJxgDU2FkQQZd7NgHIQ49CejIVh6FAHyN4mKmSu1UDRAMpWMtUSuAuea0CY123456abcd; path=/; secure
    
  6. Use the new "sid" cookie value for the next request to the redirect URL. This is the web cookie that we can use for screen scraping.

  7. The request with the new "sid" web cookie value will return the binary data of the image in the response body.

Other methods

This other answer provides more information: http://salesforce.stackexchange.com/a/46495/36144https://salesforce.stackexchange.com/a/46495/36144 , including using frontdoor.jsp .

We should also be able to get the web cookie that for scraping the RTA image, by programatically going to https://[YourSalesforceInstanceUrl].salesforce.com/secur/frontdoor.jsp?sid=[OAuthAccessToken].

The frontdoor.jsp method is another way of getting the web cookie, and may also involve following a series of redirects before finally getting the web cookie value.

I confirm Daniel Ballinger's solution on this page.

The scope needed for the OAuth token is "web: Provide access to your data via the Web (web)". According to the Salesforce documentation on Scope Parameter Values, this "Allows the ability to use the access_token on the Web" which I presume means using the Access Token as a cookie?

Steps to download a Rich Text Area (RTA) image via OAuth and curl, or similar programmatic methods:

  1. Make sure you have the correct scope for your OAuth access token. Go to the "Connected Apps" page for your OAuth connected app in Salesforce. Under "API (Enable OAuth Settings)" make sure the scope "web: Provide access to your data via the Web (web)" is included.

  2. If you were using an old refresh token with the old scope, re-authorize and get a new one with the new scope which includes "web".

  3. Get the URL of the RTA image by browsing the Knowledge article and inspecting the image src URL in your browser. The URL should look like

    https://example--c.eu3.content.force.com/servlet/rtaImage?eid=ka0w0000000U2CV&feoid=00Nw0000008eLoi&refid=0EMw00000004lzh
    
  4. Make a curl request setting your cookie "sid" to the OAuth access token value e.g.

    curl -ik --cookie 'sid=MyOauthAccessToken' 'https://example--c.eu3.content.force.com/servlet/rtaImage?eid=ka0w0000000U2CV&feoid=00Nw0000008eLoi&refid=0EMw00000004lzh'
    
  5. The request will return a 302 redirect. Do another curl with the redirect URL and set the same "sid" cookie value. Follow 3-4 subsequent redirects, using the returned redirect URL each time, until the response header includes a "Set-Cookie" giving you a new "sid" cookie value.

    Set-Cookie: sid=0023457000079pu!AR8AQO8byIe2NtMi8vd3bt5vVBFqJxgDU2FkQQZd7NgHIQ49CejIVh6FAHyN4mKmSu1UDRAMpWMtUSuAuea0CY123456abcd; path=/; secure
    
  6. Use the new "sid" cookie value for the next request to the redirect URL. This is the web cookie that we can use for screen scraping.

  7. The request with the new "sid" web cookie value will return the binary data of the image in the response body.

Other methods

This other answer provides more information: http://salesforce.stackexchange.com/a/46495/36144 , including using frontdoor.jsp .

We should also be able to get the web cookie that for scraping the RTA image, by programatically going to https://[YourSalesforceInstanceUrl].salesforce.com/secur/frontdoor.jsp?sid=[OAuthAccessToken].

The frontdoor.jsp method is another way of getting the web cookie, and may also involve following a series of redirects before finally getting the web cookie value.

I confirm Daniel Ballinger's solution on this page.

The scope needed for the OAuth token is "web: Provide access to your data via the Web (web)". According to the Salesforce documentation on Scope Parameter Values, this "Allows the ability to use the access_token on the Web" which I presume means using the Access Token as a cookie?

Steps to download a Rich Text Area (RTA) image via OAuth and curl, or similar programmatic methods:

  1. Make sure you have the correct scope for your OAuth access token. Go to the "Connected Apps" page for your OAuth connected app in Salesforce. Under "API (Enable OAuth Settings)" make sure the scope "web: Provide access to your data via the Web (web)" is included.

  2. If you were using an old refresh token with the old scope, re-authorize and get a new one with the new scope which includes "web".

  3. Get the URL of the RTA image by browsing the Knowledge article and inspecting the image src URL in your browser. The URL should look like

    https://example--c.eu3.content.force.com/servlet/rtaImage?eid=ka0w0000000U2CV&feoid=00Nw0000008eLoi&refid=0EMw00000004lzh
    
  4. Make a curl request setting your cookie "sid" to the OAuth access token value e.g.

    curl -ik --cookie 'sid=MyOauthAccessToken' 'https://example--c.eu3.content.force.com/servlet/rtaImage?eid=ka0w0000000U2CV&feoid=00Nw0000008eLoi&refid=0EMw00000004lzh'
    
  5. The request will return a 302 redirect. Do another curl with the redirect URL and set the same "sid" cookie value. Follow 3-4 subsequent redirects, using the returned redirect URL each time, until the response header includes a "Set-Cookie" giving you a new "sid" cookie value.

    Set-Cookie: sid=0023457000079pu!AR8AQO8byIe2NtMi8vd3bt5vVBFqJxgDU2FkQQZd7NgHIQ49CejIVh6FAHyN4mKmSu1UDRAMpWMtUSuAuea0CY123456abcd; path=/; secure
    
  6. Use the new "sid" cookie value for the next request to the redirect URL. This is the web cookie that we can use for screen scraping.

  7. The request with the new "sid" web cookie value will return the binary data of the image in the response body.

Other methods

This other answer provides more information: https://salesforce.stackexchange.com/a/46495/36144 , including using frontdoor.jsp .

We should also be able to get the web cookie that for scraping the RTA image, by programatically going to https://[YourSalesforceInstanceUrl].salesforce.com/secur/frontdoor.jsp?sid=[OAuthAccessToken].

The frontdoor.jsp method is another way of getting the web cookie, and may also involve following a series of redirects before finally getting the web cookie value.

added 230 characters in body
Source Link

I confirm Daniel Ballinger's solution on this page.

The scope needed for the OAuth token is "web: Provide access to your data via the Web (web)". According to the Salesforce documentation on Scope Parameter Values, this "Allows the ability to use the access_token on the Web" which I presume means using the Access Token as a cookie?

Steps to download a Rich Text Area (RTA) image via OAuth and curl, or similar programmatic methods:

  1. Make sure you have the correct scope for your OAuth access token. Go to the "Connected Apps" page for your OAuth connected app in Salesforce. Under "API (Enable OAuth Settings)" make sure the scope "web: Provide access to your data via the Web (web)" is included.

  2. If you were using an old refresh token with the old scope, re-authorize and get a new one with the new scope which includes "web".

  3. Get the URL of the RTA image by browsing the Knowledge article and inspecting the image src URL in your browser. The URL should look like

    https://example--c.eu3.content.force.com/servlet/rtaImage?eid=ka0w0000000U2CV&feoid=00Nw0000008eLoi&refid=0EMw00000004lzh
    
  4. Make a curl request setting your cookie "sid" to the OAuth access token value e.g.

    curl -ik --cookie 'sid=MyOauthAccessToken' 'https://example--c.eu3.content.force.com/servlet/rtaImage?eid=ka0w0000000U2CV&feoid=00Nw0000008eLoi&refid=0EMw00000004lzh'
    
  5. The request will return a 302 redirect. Do another curl with the redirect URL and set the same "sid" cookie value. Follow 3-4 subsequent redirects, using the returned redirect URL each time, until the response header includes a "Set-Cookie" giving you a new "sid" cookie value.

    Set-Cookie: sid=0023457000079pu!AR8AQO8byIe2NtMi8vd3bt5vVBFqJxgDU2FkQQZd7NgHIQ49CejIVh6FAHyN4mKmSu1UDRAMpWMtUSuAuea0CY123456abcd; path=/; secure
    
  6. Use the new "sid" cookie value for the next request to the redirect URL. This is the web cookie that we can use for screen scraping.

  7. The request with the new "sid" web cookie value will return the binary data of the image in the response body.

Other methods

This other answer provides more information: http://salesforce.stackexchange.com/a/46495/36144 , including using frontdoor.jsp .

We should also be able to get the web cookie that we can use to scrapefor scraping the RTA image, by programatically going to https://[YourSalesforceInstanceUrl].salesforce.com/secur/frontdoor.jsp?sid=[OAuthAccessToken].

The frontdoor.jsp method is another way of getting the web cookie, and may also involve following a series of redirects before finally getting the web cookie value.

I confirm Daniel Ballinger's solution on this page.

The scope needed for the OAuth token is "web: Provide access to your data via the Web (web)". According to the Salesforce documentation on Scope Parameter Values, this "Allows the ability to use the access_token on the Web" which I presume means using the Access Token as a cookie?

Steps to download a Rich Text Area (RTA) image via OAuth and curl, or similar programmatic methods:

  1. Make sure you have the correct scope for your OAuth access token. Go to the "Connected Apps" page for your OAuth connected app in Salesforce. Under "API (Enable OAuth Settings)" make sure the scope "web: Provide access to your data via the Web (web)" is included.

  2. If you were using an old refresh token with the old scope, re-authorize and get a new one with the new scope which includes "web".

  3. Get the URL of the RTA image by browsing the Knowledge article and inspecting the image src URL in your browser. The URL should look like

    https://example--c.eu3.content.force.com/servlet/rtaImage?eid=ka0w0000000U2CV&feoid=00Nw0000008eLoi&refid=0EMw00000004lzh
    
  4. Make a curl request setting your cookie "sid" to the OAuth access token value e.g.

    curl -ik --cookie 'sid=MyOauthAccessToken' 'https://example--c.eu3.content.force.com/servlet/rtaImage?eid=ka0w0000000U2CV&feoid=00Nw0000008eLoi&refid=0EMw00000004lzh'
    
  5. The request will return a 302 redirect. Do another curl with the redirect URL and set the same "sid" cookie value. Follow 3-4 subsequent redirects, using the returned redirect URL each time, until the response header includes a "Set-Cookie" giving you a new "sid" cookie value.

    Set-Cookie: sid=0023457000079pu!AR8AQO8byIe2NtMi8vd3bt5vVBFqJxgDU2FkQQZd7NgHIQ49CejIVh6FAHyN4mKmSu1UDRAMpWMtUSuAuea0CY123456abcd; path=/; secure
    
  6. Use the new "sid" cookie value for the next request to the redirect URL.

  7. The request with the new "sid" cookie value will return the binary data of the image in the response body.

Other methods

This other answer provides more information: http://salesforce.stackexchange.com/a/46495/36144 , including using frontdoor.jsp .

We should be able to get the web cookie that we can use to scrape the RTA image, by programatically going to https://[YourSalesforceInstanceUrl].salesforce.com/secur/frontdoor.jsp?sid=[OAuthAccessToken] .

I confirm Daniel Ballinger's solution on this page.

The scope needed for the OAuth token is "web: Provide access to your data via the Web (web)". According to the Salesforce documentation on Scope Parameter Values, this "Allows the ability to use the access_token on the Web" which I presume means using the Access Token as a cookie?

Steps to download a Rich Text Area (RTA) image via OAuth and curl, or similar programmatic methods:

  1. Make sure you have the correct scope for your OAuth access token. Go to the "Connected Apps" page for your OAuth connected app in Salesforce. Under "API (Enable OAuth Settings)" make sure the scope "web: Provide access to your data via the Web (web)" is included.

  2. If you were using an old refresh token with the old scope, re-authorize and get a new one with the new scope which includes "web".

  3. Get the URL of the RTA image by browsing the Knowledge article and inspecting the image src URL in your browser. The URL should look like

    https://example--c.eu3.content.force.com/servlet/rtaImage?eid=ka0w0000000U2CV&feoid=00Nw0000008eLoi&refid=0EMw00000004lzh
    
  4. Make a curl request setting your cookie "sid" to the OAuth access token value e.g.

    curl -ik --cookie 'sid=MyOauthAccessToken' 'https://example--c.eu3.content.force.com/servlet/rtaImage?eid=ka0w0000000U2CV&feoid=00Nw0000008eLoi&refid=0EMw00000004lzh'
    
  5. The request will return a 302 redirect. Do another curl with the redirect URL and set the same "sid" cookie value. Follow 3-4 subsequent redirects, using the returned redirect URL each time, until the response header includes a "Set-Cookie" giving you a new "sid" cookie value.

    Set-Cookie: sid=0023457000079pu!AR8AQO8byIe2NtMi8vd3bt5vVBFqJxgDU2FkQQZd7NgHIQ49CejIVh6FAHyN4mKmSu1UDRAMpWMtUSuAuea0CY123456abcd; path=/; secure
    
  6. Use the new "sid" cookie value for the next request to the redirect URL. This is the web cookie that we can use for screen scraping.

  7. The request with the new "sid" web cookie value will return the binary data of the image in the response body.

Other methods

This other answer provides more information: http://salesforce.stackexchange.com/a/46495/36144 , including using frontdoor.jsp .

We should also be able to get the web cookie that for scraping the RTA image, by programatically going to https://[YourSalesforceInstanceUrl].salesforce.com/secur/frontdoor.jsp?sid=[OAuthAccessToken].

The frontdoor.jsp method is another way of getting the web cookie, and may also involve following a series of redirects before finally getting the web cookie value.

added 153 characters in body
Source Link

I confirm Daniel Ballinger's solution on this page.

The scope needed for the OAuth token is "web: Provide access to your data via the Web (web)". According to the Salesforce documentation on Scope Parameter Values, this "Allows the ability to use the access_token on the Web" which I presume means using the Access Token as a cookie?

Steps to download a Rich Text Area (RTA) image via OAuth and curl, or similar programmatic methods:

  1. Make sure you have the correct scope for your OAuth access token. Go to the "Connected Apps" page for your OAuth connected app in Salesforce. Under "API (Enable OAuth Settings)" make sure the scope "web: Provide access to your data via the Web (web)" is included.

  2. If you were using an old refresh token with the old scope, re-authorize and get a new one with the new scope which includes "web".

  3. Get the URL of the RTA image by browsing the Knowledge article and inspecting the image src URL in your browser. The URL should look like

    https://example--c.eu3.content.force.com/servlet/rtaImage?eid=ka0w0000000U2CV&feoid=00Nw0000008eLoi&refid=0EMw00000004lzh
    
  4. Make a curl request setting your cookie "sid" to the OAuth access token value e.g.

    curl -ik --cookie 'sid=MyOauthAccessToken' 'https://example--c.eu3.content.force.com/servlet/rtaImage?eid=ka0w0000000U2CV&feoid=00Nw0000008eLoi&refid=0EMw00000004lzh'
    
  5. The request will return a 302 redirect. Do another curl with the redirect URL and set the same "sid" cookie value. Follow 3-4 subsequent redirects, using the returned redirect URL each time, until the response header includes a "Set-Cookie" giving you a new "sid" cookie value.

    Set-Cookie: sid=0023457000079pu!AR8AQO8byIe2NtMi8vd3bt5vVBFqJxgDU2FkQQZd7NgHIQ49CejIVh6FAHyN4mKmSu1UDRAMpWMtUSuAuea0CY123456abcd; path=/; secure
    
  6. Use the new "sid" cookie value for the next request to the redirect URL.

  7. The request with the new "sid" cookie value will return the binary data of the image in the response body.

Other methods

This other answer provides more information: http://salesforce.stackexchange.com/a/46495/36144 , including using frontdoorfrontdoor.jsp .jsp to login

We should be able to Salesforce programatically forget the screenscraping request,web cookie that we can use to getscrape the RTA image, by programatically going to https://[YourSalesforceInstanceUrl].salesforce.com/secur/frontdoor.jsp?sid=[OAuthAccessToken] .

I confirm Daniel Ballinger's solution on this page.

The scope needed for the OAuth token is "web: Provide access to your data via the Web (web)". According to the Salesforce documentation on Scope Parameter Values, this "Allows the ability to use the access_token on the Web" which I presume means using the Access Token as a cookie?

Steps to download a Rich Text Area (RTA) image via OAuth and curl, or similar programmatic methods:

  1. Make sure you have the correct scope for your OAuth access token. Go to the "Connected Apps" page for your OAuth connected app in Salesforce. Under "API (Enable OAuth Settings)" make sure the scope "web: Provide access to your data via the Web (web)" is included.

  2. If you were using an old refresh token with the old scope, re-authorize and get a new one with the new scope which includes "web".

  3. Get the URL of the RTA image by browsing the Knowledge article and inspecting the image src URL in your browser. The URL should look like

    https://example--c.eu3.content.force.com/servlet/rtaImage?eid=ka0w0000000U2CV&feoid=00Nw0000008eLoi&refid=0EMw00000004lzh
    
  4. Make a curl request setting your cookie "sid" to the OAuth access token value e.g.

    curl -ik --cookie 'sid=MyOauthAccessToken' 'https://example--c.eu3.content.force.com/servlet/rtaImage?eid=ka0w0000000U2CV&feoid=00Nw0000008eLoi&refid=0EMw00000004lzh'
    
  5. The request will return a 302 redirect. Do another curl with the redirect URL and set the same "sid" cookie value. Follow 3-4 subsequent redirects, using the returned redirect URL each time, until the response header includes a "Set-Cookie" giving you a new "sid" cookie value.

    Set-Cookie: sid=0023457000079pu!AR8AQO8byIe2NtMi8vd3bt5vVBFqJxgDU2FkQQZd7NgHIQ49CejIVh6FAHyN4mKmSu1UDRAMpWMtUSuAuea0CY123456abcd; path=/; secure
    
  6. Use the new "sid" cookie value for the next request to the redirect URL.

  7. The request with the new "sid" cookie value will return the binary data of the image in the response body.

This other answer provides more information: http://salesforce.stackexchange.com/a/46495/36144 , including using frontdoor.jsp to login to Salesforce programatically for the screenscraping request, to get the RTA image.

I confirm Daniel Ballinger's solution on this page.

The scope needed for the OAuth token is "web: Provide access to your data via the Web (web)". According to the Salesforce documentation on Scope Parameter Values, this "Allows the ability to use the access_token on the Web" which I presume means using the Access Token as a cookie?

Steps to download a Rich Text Area (RTA) image via OAuth and curl, or similar programmatic methods:

  1. Make sure you have the correct scope for your OAuth access token. Go to the "Connected Apps" page for your OAuth connected app in Salesforce. Under "API (Enable OAuth Settings)" make sure the scope "web: Provide access to your data via the Web (web)" is included.

  2. If you were using an old refresh token with the old scope, re-authorize and get a new one with the new scope which includes "web".

  3. Get the URL of the RTA image by browsing the Knowledge article and inspecting the image src URL in your browser. The URL should look like

    https://example--c.eu3.content.force.com/servlet/rtaImage?eid=ka0w0000000U2CV&feoid=00Nw0000008eLoi&refid=0EMw00000004lzh
    
  4. Make a curl request setting your cookie "sid" to the OAuth access token value e.g.

    curl -ik --cookie 'sid=MyOauthAccessToken' 'https://example--c.eu3.content.force.com/servlet/rtaImage?eid=ka0w0000000U2CV&feoid=00Nw0000008eLoi&refid=0EMw00000004lzh'
    
  5. The request will return a 302 redirect. Do another curl with the redirect URL and set the same "sid" cookie value. Follow 3-4 subsequent redirects, using the returned redirect URL each time, until the response header includes a "Set-Cookie" giving you a new "sid" cookie value.

    Set-Cookie: sid=0023457000079pu!AR8AQO8byIe2NtMi8vd3bt5vVBFqJxgDU2FkQQZd7NgHIQ49CejIVh6FAHyN4mKmSu1UDRAMpWMtUSuAuea0CY123456abcd; path=/; secure
    
  6. Use the new "sid" cookie value for the next request to the redirect URL.

  7. The request with the new "sid" cookie value will return the binary data of the image in the response body.

Other methods

This other answer provides more information: http://salesforce.stackexchange.com/a/46495/36144 , including using frontdoor.jsp .

We should be able to get the web cookie that we can use to scrape the RTA image, by programatically going to https://[YourSalesforceInstanceUrl].salesforce.com/secur/frontdoor.jsp?sid=[OAuthAccessToken] .

added 96 characters in body
Source Link
Loading
added 400 characters in body
Source Link
Loading
added 164 characters in body
Source Link
Loading
Source Link
Loading