<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IDIFY Solutions LLP &#187; API</title>
	<atom:link href="http://blog.idifysolutions.com/category/application-programming-interface/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.idifysolutions.com</link>
	<description>I Do It For You</description>
	<lastBuildDate>Wed, 13 Mar 2013 14:59:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Update Shipping info in Chargify</title>
		<link>http://blog.idifysolutions.com/2011/10/update-shipping-info-in-chargify/</link>
		<comments>http://blog.idifysolutions.com/2011/10/update-shipping-info-in-chargify/#comments</comments>
		<pubDate>Fri, 07 Oct 2011 17:02:47 +0000</pubDate>
		<dc:creator>pardeep</dc:creator>
				<category><![CDATA[Chargify]]></category>

		<guid isPermaLink="false">http://blog.idifysolutions.com/?p=130</guid>
		<description><![CDATA[Today I went through really a big issue , I am trying to update shipping information in Chargify using its api. Code written below is the code which I tried to update the shipping info parameters = { "subscription" =&#62; { "customer_attributes" =&#62; { "first_name" =&#62; "shipping_first_name", "last_name" =&#62; shipping_last_name, "address" =&#62; shipping_address, "address_2" =&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>Today I went through really a big issue , I am trying to update shipping information in Chargify using its api.</p>
<p>Code written below is the code which I tried to update the shipping info</p>
<p><span id="more-130"></span></p>
<pre>        parameters = {
          "subscription" =&gt; {
            "customer_attributes" =&gt; {
              "first_name" =&gt; "shipping_first_name",
              "last_name" =&gt; shipping_last_name,
              "address" =&gt; shipping_address,
              "address_2" =&gt; shipping_address_2,
              "city" =&gt; shipping_city,
              "state" =&gt; shipping_state,
              "zip" =&gt; shipping_postal_code,
              "country" =&gt; shipping_country
            }
          }
        }
        response = `curl -i -X PUT -d '#{parameters.to_json}' -H 'Content-Type: application/json' -u #{Chargify.api_key}:x https://#{Chargify.subdomain}.chargify.com/subscriptions/#{chargify_subscription.id}.json`</pre>
<pre><strong> This code will return you response code 200. i.e. data updated successfully.</strong></pre>
<pre><strong> But this will actually not update shipping info.</strong></pre>
<pre><strong> Got Confused .....?</strong></pre>
<pre><strong> I was also confused.Then I raised ticket regarding this issue in chargify support.</strong></pre>
<pre><strong> They replied that its not possible to change the shipping info using the Chargify API.</strong></pre>
<pre><strong>
</strong></pre>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://blog.idifysolutions.com/2011/10/update-shipping-info-in-chargify/" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.idifysolutions.com/2011/10/update-shipping-info-in-chargify/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>To change current status of linkedin from your own site.</title>
		<link>http://blog.idifysolutions.com/2011/09/to-change-current-status-of-linkedin-from-your-own-site/</link>
		<comments>http://blog.idifysolutions.com/2011/09/to-change-current-status-of-linkedin-from-your-own-site/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 10:05:29 +0000</pubDate>
		<dc:creator>pardeep</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[LinkedIn]]></category>

		<guid isPermaLink="false">http://blog.idifysolutions.com/?p=75</guid>
		<description><![CDATA[Add this code in the function which you call from authentication(function) Like:: function onLinkedInAuth() { IN.API.Profile(&#8220;me&#8221;).fields(&#8220;id&#8221;,&#8221;firstName&#8221;, &#8220;lastName&#8221;, &#8220;industry&#8221;, &#8220;numConnections&#8221;,&#8221;educations&#8221;,&#8221;location&#8221;,&#8221;headline&#8221;,&#8221;publicProfileUrl&#8221;).result(CurrentStatus); } function CurrentStatus(profiles) { member = profiles.values[0]; document.getElementById(&#8216;LinkedIn_Id&#8217;).value=member.id; //This function updates the status IN.API.Raw(&#8220;/people/~/current-status&#8221;) // Update (PUT) the status .method(&#8220;PUT&#8221;) .body(JSON.stringify(&#8220;linked in status update via api again&#8221;)) } Deepak Sharma help me in finding this function. [...]]]></description>
			<content:encoded><![CDATA[<p>Add this code in the function which you call from authentication(function)</p>
<p>Like::</p>
<p>function onLinkedInAuth()<br />
{<br />
IN.API.Profile(&#8220;me&#8221;).fields(&#8220;id&#8221;,&#8221;firstName&#8221;, &#8220;lastName&#8221;, &#8220;industry&#8221;, &#8220;numConnections&#8221;,&#8221;educations&#8221;,&#8221;location&#8221;,&#8221;headline&#8221;,&#8221;publicProfileUrl&#8221;).result(CurrentStatus);</p>
<p>}<br />
function CurrentStatus(profiles) {<br />
member = profiles.values[0];<br />
document.getElementById(&#8216;LinkedIn_Id&#8217;).value=member.id;</p>
<p>//This function updates the status<br />
IN.API.Raw(&#8220;/people/~/current-status&#8221;) // Update (PUT) the status<br />
.method(&#8220;PUT&#8221;)<br />
.body(JSON.stringify(&#8220;linked in status update via api again&#8221;))</p>
<p>}</p>
<p>Deepak Sharma help me in finding this function.</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://blog.idifysolutions.com/2011/09/to-change-current-status-of-linkedin-from-your-own-site/" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.idifysolutions.com/2011/09/to-change-current-status-of-linkedin-from-your-own-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chargify API : Charge card using Basic authentication and Post Request</title>
		<link>http://blog.idifysolutions.com/2011/09/chargify-api-charge-card-using-basic-authentication/</link>
		<comments>http://blog.idifysolutions.com/2011/09/chargify-api-charge-card-using-basic-authentication/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 17:21:01 +0000</pubDate>
		<dc:creator>pardeep</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[Chargify]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.idifysolutions.com/?p=61</guid>
		<description><![CDATA[require &#8220;net/https&#8221; require &#8220;uri&#8221; data = Hash.new data["charge"] = Hash.new data["charge"]["amount"] = amount_to_charge data["charge"]["memo"] = &#8216;This is the description of the one time charge.&#8217; or you can create hash using data = { &#8220;charge&#8221; =&#62;{ &#8220;amount&#8221;  =&#62; amount_to_change, &#8220;memo&#8221;    =&#62; &#8216;This is the description of the one time charge.&#8217;             [...]]]></description>
			<content:encoded><![CDATA[<p><strong>require &#8220;net/https&#8221; </strong></p>
<p><strong>require &#8220;uri&#8221;</strong></p>
<p>data = Hash.new</p>
<p>data["charge"] = Hash.new</p>
<p>data["charge"]["amount"] = amount_to_charge</p>
<p>data["charge"]["memo"] = &#8216;This is the description of the one time charge.&#8217;</p>
<p>or</p>
<p><span id="more-61"></span></p>
<p><strong>you can create hash using</strong></p>
<p>data = {</p>
<p>&#8220;charge&#8221; <strong>=&gt;{</strong></p>
<p>&#8220;amount&#8221; <strong> =&gt;</strong> amount_to_change,</p>
<p>&#8220;memo&#8221;   <strong> =&gt; </strong>&#8216;This is the description of the one time charge.&#8217;</p>
<p><strong>              }</strong></p>
<p>}</p>
<p>url = &#8220;https://#{<strong>Chargify.subdomain</strong>}.chargify.com/subscriptions/#{<strong>chargify_subscription.id</strong>}/charges.json&#8221;</p>
<p>#chargify.subdomain  is <strong>subdomain name</strong> assigned to your api</p>
<p>#chargify_subscription.id is <strong>Subscription id</strong></p>
<p>uri = URI.parse(url)</p>
<p>http = Net::HTTP.new(uri.host, uri.port)</p>
<p>http.use_ssl = true</p>
<p>http.verify_mode = OpenSSL::SSL::VERIFY_NONE</p>
<p>request = Net::HTTP::Post.new(uri.request_uri, initheader = {&#8216;Content-Type&#8217; =&gt;&#8217;application/json&#8217;})</p>
<p>request.body = data.to_json</p>
<p>request.basic_auth(&#8220;#{Chargify.api_key}&#8221;, &#8220;x&#8221;)</p>
<p>response = http.request(request)</p>
<p><strong>if response.code != &#8217;201&#8242;</strong></p>
<p>subscription_errors = response.to_json</p>
<p>error_message = &#8216;<strong>Sorry! We were unable to change your subscription.</strong>&#8216;</p>
<p>flash[:error] = error_message</p>
<p>redirect_to(&#8220;/account/finalize&#8221;)</p>
<p>return</p>
<p><strong>end</strong></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://blog.idifysolutions.com/2011/09/chargify-api-charge-card-using-basic-authentication/" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.idifysolutions.com/2011/09/chargify-api-charge-card-using-basic-authentication/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>LinkedIn Login</title>
		<link>http://blog.idifysolutions.com/2011/09/linkedin-login/</link>
		<comments>http://blog.idifysolutions.com/2011/09/linkedin-login/#comments</comments>
		<pubDate>Mon, 05 Sep 2011 04:52:44 +0000</pubDate>
		<dc:creator>pardeep</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[LinkedIn]]></category>
		<category><![CDATA[Open Source Technologies]]></category>

		<guid isPermaLink="false">http://blog.idifysolutions.com/?p=53</guid>
		<description><![CDATA[&#160; LinkedIn Page where you define your App and get an API key. https://www.linkedin.com/secure/developer Place where u need to have linkedin Login Button: &#60;script type=&#8221;in/Login&#8221;&#62;&#60;/script&#62; Javascript Used  for LinkedIn Login, where you define the linkedin App(for which you need to login) API Key, the function run on Onload event: &#60;script type=&#8221;text/javascript&#8221; src=&#8221;http://platform.linkedin.com/in.js&#8221;&#62; api_key: 5FfrZc4k8eeN96ARU1vB-sNogP89zUSsu6T_bMEHL5qUubivfrvj-mTVCvKvjajL onLoad: [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>LinkedIn Page where you define your App and get an API key.</p>
<p><a href="https://www.linkedin.com/secure/developer">https://www.linkedin.com/secure/developer</a></p>
<p>Place where u need to have linkedin Login Button:</p>
<p>&lt;script type=&#8221;in/Login&#8221;&gt;&lt;/script&gt;</p>
<p>Javascript Used  for LinkedIn Login, where you define the linkedin App(for which you need to login) API Key, the function run on Onload event:</p>
<p>&lt;script type=&#8221;text/javascript&#8221; src=&#8221;http://platform.linkedin.com/in.js&#8221;&gt;<br />
api_key: 5FfrZc4k8eeN96ARU1vB-sNogP89zUSsu6T_bMEHL5qUubivfrvj-mTVCvKvjajL<br />
onLoad: onLinkedInLoad<br />
authorize: true<br />
&lt;/script&gt;</p>
<p><span id="more-53"></span><br />
&lt;script type=&#8221;text/javascript&#8221;&gt;</p>
<p>//  Runs when the JavaScript framework is loaded</p>
<p>function onLinkedInLoad() {</p>
<p>IN.Event.on(IN, &#8220;auth&#8221;, onLinkedInAuth);</p>
<p>}</p>
<p>//  Runs when the viewer has authenticated<br />
function onLinkedInAuth() {<br />
IN.API.Profile(&#8220;me&#8221;).fields(&#8220;id&#8221;,&#8221;firstName&#8221;, &#8220;lastName&#8221;,&#8221;industry&#8221;)<br />
.result(displayProfiles);<br />
}</p>
<p>// Runs when the Profile() API call returns successfully<br />
function displayProfiles(profiles) {<br />
member = profiles.values[0];<br />
alert(member.id); //  alert to see the member&#8217;s id</p>
<p>}<br />
&lt;/script&gt;</p>
<p>&nbsp;</p>
<p>LinkedIn doesn&#8217;t provide you the email of the user(member).</p>
<p>//Ajax to check Email Verification is already done or not (ask email from the user)</p>
<p>var reply=confirm(&#8220;You are logged in LinkedIn with &#8220;+member.firstName+&#8221;\n Do you want to SignIn with different user in changethinkers?&#8221;);<br />
if (reply==true)<br />
{<br />
window.location=&#8221;&lt;cfoutput&gt;#viewstate.getValue(&#8220;myself&#8221;)#login&amp;NotLogin=0&lt;/cfoutput&gt;&#8221;<br />
}<br />
else<br />
{<br />
var form = new Element(&#8216;form&#8217;,<br />
{method: &#8216;post&#8217;, action: &#8216;#viewstate.getValue(&#8220;myself&#8221;)#CheckLinedIn&amp;id=&#8217;+member.id});<br />
form.insert(new Element(&#8216;input&#8217;,<br />
{name: &#8216;id&#8217;, value: member.id, type: &#8216;hidden&#8217;}));</p>
<p>$(document.body).insert(form);<br />
form.submit();<br />
}</p>
<p>// LinkedIn Logout Event</p>
<p>IN.User.logout();</p>
<p>For more information visit:- <a href="https://developer.linkedin.com/documents/javascript-api-tutorial">https://developer.linkedin.com/documents/javascript-api-tutorial</a></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://blog.idifysolutions.com/2011/09/linkedin-login/" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.idifysolutions.com/2011/09/linkedin-login/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
