Skip to content

Instantly share code, notes, and snippets.

@fayefaye02
fayefaye02 / SimpleProxyClient.page
Created October 20, 2015 22:47 — forked from richardvanhook/SimpleProxyClient.page
Simple VF page that demonstrates how to hit REST API. NOTE: User must have access to Chatter REST API for this exact demo to work.
<apex:page docType="html-5.0" sidebar="false" showHeader="false"
standardStylesheets="false" cache="true">
<!-- TRANSFORM PARTNER URL INTO TRUE PROXY URL -->
<apex:variable var="PARTNER_URL" value="{!$Api.Partner_Server_URL_290}" />
<apex:variable var="PARTNER_URL_SPLIT" value="{!
LEFT(PARTNER_URL,FIND('.visual.force.com',PARTNER_URL)-1)
}"/>
<apex:variable var="POD" value="{!
MID(PARTNER_URL_SPLIT,FIND('.',PARTNER_URL_SPLIT)+1,LEN(PARTNER_URL_SPLIT))
@fayefaye02
fayefaye02 / gist:9b9d08e52e89e2c763ef
Created October 20, 2015 22:47 — forked from henriquez/gist:3146782
Example Javascript that uses ajax proxy to make request to Chatter API
<apex:page controller="CustomerCommunityController" id="customercommunitycontroller" sidebar="false" showHeader="false" standardStylesheets="false" >
<head>
<title>Acme Customer Support</title>
<meta charset="utf-8" />
<apex:includeScript value="{!$Resource.jquery}"/>
</head>
<script type="text/javascript">