<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hi Joylon<br>
      <br>
      Thanks for that.&nbsp; I will make it ANSI.&nbsp; Before I do I have a
      couple of extra questions, hopefully that will be it....<br>
      <br>
      I assume conkey and consecret are my consumer public &amp; private
      keys.&nbsp; However I am unsure about tok (which I assume is a public
      token).&nbsp; In a public app I would be assigned a token as part of
      the login process, where do I get this from for a private login?&nbsp;
      Is it my apps name?<br>
      <br>
      Cheers<br>
      Rob<br>
      <br>
      &nbsp; On 8/07/2014 12:56 p.m., Jolyon Smith wrote:<br>
    </div>
    <blockquote
cite="mid:CALXexOpu1QPMyzBGh0Q1T4SP+K68sqT+sFA3u_CmYS2_Ct9=0A@mail.gmail.com"
      type="cite">
      <div dir="ltr">You can ignore the ProcessTags() calls -
        essentially they just do variable substitution within the
        strings involved.<br>
        <br>
        There is no login for private Xero apps, which are tied to a
        specific Xero organisation. &Acirc;&nbsp;You need to setup your application
        on the Xero API end for that specific organisation, to generate
        the required key and secrets etc which you use to do the signing
        of your requests.<br>
        <br>
        <br>
        <div>w.r.t Unicode, the code was written for deployment with a
          pre-Unicode Delphi compiler. &Acirc;&nbsp;Some of the code was either
          written for or adapted from libraries which were or had been
          ANSI-fied to ensure consistent behaviour for use with Unicode
          versions of Delphi, but the remaining code otherwise assumes
          ANSI strings. &Acirc;&nbsp;If you are using a Unicode Delphi version you
          should change <b>all </b>declarations to ANSIString to
          maintain the intended behaviour and be careful of implicit
          string conversions when making calls into the routines.<br>
          <br>
          To make it properly Unicode enabled may involve more
          significant change than that.
          <div><br>
          </div>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On 8 July 2014 11:43, Robert Martin <span
            dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:rob@chreos.co.nz" target="_blank">rob@chreos.co.nz</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div text="#000000" bgcolor="#FFFFFF">
              <div>Hi Cameron&Acirc;&nbsp; <br>
                <br>
                Sorry to bug you but....&Acirc;&nbsp; I have the code installed and
                compiling however I am a bit unsure as to the process
                involved.<br>
                <br>
                For Public apps you go through a process of logging in
                and getting a token.&Acirc;&nbsp; <br>
                <br>
                For private applications do you just call the API you
                want and encode the call using
                'OAuthSignRequest(fHTTP.Request, 'POST', lURL);' or do
                you need to do some sort of log in as well?<br>
                <br>
                In the OAuthSignRequest method there are calls to a
                function called ProcessTags( as below...<br>
                <br>
                &Acirc;&nbsp;&Acirc;&nbsp; conkey&Acirc;&nbsp;&Acirc;&nbsp;&Acirc;&nbsp; := ProcessTags(OAuthConsumerKey,&Acirc;&nbsp;&Acirc;&nbsp;&Acirc;&nbsp;
                Locals, Partner);<br>
                &Acirc;&nbsp;&Acirc;&nbsp;&Acirc;&nbsp; consecret := ProcessTags(OAuthConsumerSecret,
                Locals, Partner);<br>
                &Acirc;&nbsp;&Acirc;&nbsp;&Acirc;&nbsp; tok&Acirc;&nbsp;&Acirc;&nbsp;&Acirc;&nbsp;&Acirc;&nbsp;&Acirc;&nbsp;&Acirc;&nbsp; :=
                ProcessTags(OAuthTokenKey,&Acirc;&nbsp;&Acirc;&nbsp;&Acirc;&nbsp;&Acirc;&nbsp;&Acirc;&nbsp;&Acirc;&nbsp; Locals, Partner);<br>
                &Acirc;&nbsp;&Acirc;&nbsp;&Acirc;&nbsp; toksecret := ProcessTags(OAuthTokenSecret,&Acirc;&nbsp;&Acirc;&nbsp;&Acirc;&nbsp;
                Locals, Partner);<br>
                <br>
                I guess this function would be in the classFloCommon.pas
                (not included) that we 'can easily replace'.&Acirc;&nbsp;
                Unfortunately I have no idea what this function does or
                what its inputs are asside from it returning a string
                and that all the parameters are globals !&Acirc;&nbsp; Any hints?<br>
                <br>
                Sorry to be a pain but this OAuth stuff is like pulling
                teeth. <br>
                <div class=""> <br>
                  <br>
                  Cheers<br>
                  Rob<br>
                  <br>
                  <br>
                  <br>
                  On 8/07/2014 9:54 a.m., Cameron Hart wrote:<br>
                </div>
              </div>
              <blockquote type="cite">
                <div>
                  <div class="h5">
                    <div>
                      <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">this



                          code has been shared with Xero a while ago on
                          their forum.&Acirc;&nbsp; there&acirc;&#128;&#153;s a copy on <a
                            moz-do-not-send="true"
                            href="ftp://ftp.flow.net.nz/RELEASE/Code/"
                            target="_blank">ftp://ftp.flow.net.nz/RELEASE/Code/</a></span></p>
                      <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">&Acirc;&nbsp;</span></p>
                      <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">&Acirc;&nbsp;</span></p>
                      <table style="width:525.0pt" cellpadding="0"
                        width="700" border="0">
                        <tbody>
                          <tr style="height:26.25pt">
                            <td colspan="4" style="padding:0cm 0cm 0cm
                              0cm;height:26.25pt">
                              <p class="MsoNormal"><b><span>Cameron Hart
                                  </span></b><span></span></p>
                            </td>
                          </tr>
                          <tr>
                            <td style="width:17.25pt;padding:0cm 0cm 0cm
                              0cm" width="23"><br>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                              <p class="MsoNormal"><b><span>Flow
                                    Software Limited </span></b><span></span></p>
                            </td>
                            <td rowspan="4"
                              style="width:3.75pt;padding:0cm 0cm 0cm
                              0cm" valign="bottom" width="5">
                              <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><img
src="cid:part3.07010702.07060409@chreos.co.nz" width="1" border="0"
                                    height="55"></span><span></span></p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm"><br>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm"><br>
                            </td>
                            <td rowspan="4" style="padding:0cm 0cm 0cm
                              0cm">
                              <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><img
src="cid:part4.08080306.00000402@chreos.co.nz" alt="Flow" width="158"
                                    border="0" height="38"></span><span></span></p>
                            </td>
                          </tr>
                          <tr>
                            <td style="padding:0cm 0cm 0cm 0cm"><br>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                              <p class="MsoNormal"><span>PO Box 302 768,
                                  North Harbour </span><span></span></p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                              <p class="MsoNormal"><b><span>P </span></b><span></span></p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                              <p class="MsoNormal"><span>+64 9 476 3569</span><span></span></p>
                            </td>
                          </tr>
                          <tr>
                            <td style="padding:0cm 0cm 0cm 0cm"><br>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                              <p class="MsoNormal"><span>Auckland 0751,
                                  New Zealand </span><span></span></p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                              <p class="MsoNormal"><b><span>M </span></b><span></span></p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                              <p class="MsoNormal"><span>+64 21 222 3569
                                </span><span></span></p>
                            </td>
                          </tr>
                          <tr>
                            <td style="padding:0cm 0cm 0cm 0cm"><br>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                              <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><a
                                    moz-do-not-send="true"
                                    href="http://www.flowsoftware.co.nz"
                                    target="_blank"><span>www.flowsoftware.co.nz



                                    </span></a></span><span></span></p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                              <p class="MsoNormal"><b><span>E </span></b><span></span></p>
                            </td>
                            <td style="padding:0cm 0cm 0cm 0cm">
                              <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><a
                                    moz-do-not-send="true"
                                    href="mailto:cameron.hart@flowsoftware.co.nz"
                                    target="_blank"><span>cameron.hart@flowsoftware.co.nz



                                    </span></a></span><span></span></p>
                            </td>
                          </tr>
                        </tbody>
                      </table>
                      <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">&Acirc;&nbsp;</span><span></span></p>
                      <table style="width:487.5pt" cellpadding="0"
                        width="650" border="0">
                        <tbody>
                          <tr style="height:26.25pt">
                            <td style="padding:0cm 0cm 0cm
                              0cm;height:26.25pt">
                              <p class="MsoNormal"><span>This message is
                                  intended for the addressee named
                                  above. It may contain privileged or
                                  confidential information. If you are
                                  not the intended recipient of this
                                  message you must not use, copy,
                                  distribute or disclose it to anyone. </span>
                                <span></span></p>
                            </td>
                          </tr>
                        </tbody>
                      </table>
                      <p class="MsoNormal"><span
style="font-size:8.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#92c75f">&Acirc;&nbsp;</span><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">
                        </span><span
                          style="font-size:8.0pt;font-family:Webdings;color:#92c75f">P</span><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">
                        </span><span>Please consider the environment
                          before printing this email</span><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">
                        </span><span></span></p>
                      <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">&Acirc;&nbsp;</span></p>
                      <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">&Acirc;&nbsp;</span></p>
                      <p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"
                            lang="EN-US">From:</span></b><span
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"
                          lang="EN-US"> <a moz-do-not-send="true"
                            href="mailto:delphi-bounces@listserver.123.net.nz"
                            target="_blank">delphi-bounces@listserver.123.net.nz</a>
                          [<a moz-do-not-send="true"
                            href="mailto:delphi-bounces@listserver.123.net.nz"
                            target="_blank">mailto:delphi-bounces@listserver.123.net.nz</a>]
                          <b>On Behalf Of </b>Jolyon Smith<br>
                          <b>Sent:</b> Tuesday, 8 July 2014 9:14 a.m.<br>
                          <b>To:</b> NZ Borland Developers Group -
                          Delphi List<br>
                          <b>Subject:</b> Re: [DUG] Xero private API
                          (OAuth)</span></p>
                      <p class="MsoNormal">&Acirc;&nbsp;</p>
                      <div>
                        <p class="MsoNormal">This was a nut I had to
                          crack at Flow. &Acirc;&nbsp;I was successful in this
                          endeavour but I'm not at liberty to share the
                          fruits of those labors. &Acirc;&nbsp;If you ask nicely
                          however, Cameron might be willing to help.</p>
                      </div>
                      <div>
                        <p class="MsoNormal"
                          style="margin-bottom:12.0pt">&Acirc;&nbsp;</p>
                        <div>
                          <p class="MsoNormal">On 8 July 2014 08:52,
                            Robert Martin &lt;<a moz-do-not-send="true"
                              href="mailto:rob@chreos.co.nz"
                              target="_blank">rob@chreos.co.nz</a>&gt;
                            wrote:</p>
                          <p class="MsoNormal">Hi<br>
                            <br>
                            I have been doing some work with the Xero
                            API and have public OAuth<br>
                            working fine. &Acirc;&nbsp;However I actually need to
                            use the private API which<br>
                            requires RSA-SHA1 &Acirc;&nbsp;which I believe just
                            means RSA signing. &Acirc;&nbsp;Is that correct?<br>
                            <br>
                            If so does anyone have any code examples of
                            RSA signing, I have found<br>
                            LockBox 3 which is supposed to do it but I
                            just cant get it installed,<br>
                            although the source has a XE2 project group
                            the code is full of errors !<br>
                            <br>
                            I am looking at using the openSLL dll calls
                            to do it myself as an<br>
                            alternative but sample code is scarce. I
                            will continue looking but if<br>
                            anyone has any pointers I would be grateful
                            :)<br>
                            <br>
                            Cheers<br>
                            Rob<br>
                            <br>
_______________________________________________<br>
                            NZ Borland Developers Group - Delphi mailing
                            list<br>
                            Post: <a moz-do-not-send="true"
                              href="mailto:delphi@listserver.123.net.nz"
                              target="_blank">delphi@listserver.123.net.nz</a><br>
                            Admin: <a moz-do-not-send="true"
                              href="http://delphi.org.nz/mailman/listinfo/delphi"
                              target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
                            Unsubscribe: send an email to <a
                              moz-do-not-send="true"
                              href="mailto:delphi-request@listserver.123.net.nz"
                              target="_blank">
                              delphi-request@listserver.123.net.nz</a>
                            with Subject: unsubscribe</p>
                        </div>
                        <p class="MsoNormal">&Acirc;&nbsp;</p>
                      </div>
                    </div>
                    <br>
                    <fieldset></fieldset>
                    <br>
                    <pre>_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: <a moz-do-not-send="true" href="mailto:delphi@listserver.123.net.nz" target="_blank">delphi@listserver.123.net.nz</a>
Admin: <a moz-do-not-send="true" href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a>
Unsubscribe: send an email to <a moz-do-not-send="true" href="mailto:delphi-request@listserver.123.net.nz" target="_blank">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe</pre>
                    <br>
                    <fieldset></fieldset>
                    <br>
                  </div>
                </div>
                <div class="">
                  <p color="#000000" align="left">No virus found in this
                    message.<br>
                    Checked by AVG - <a moz-do-not-send="true"
                      href="http://www.avg.com" target="_blank">www.avg.com</a><br>
                    Version: 2014.0.4716 / Virus Database: 3986/7813 -
                    Release Date: 07/07/14</p>
                </div>
              </blockquote>
              <br>
            </div>
            <br>
            _______________________________________________<br>
            NZ Borland Developers Group - Delphi mailing list<br>
            Post: <a moz-do-not-send="true"
              href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a><br>
            Admin: <a moz-do-not-send="true"
              href="http://delphi.org.nz/mailman/listinfo/delphi"
              target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
            Unsubscribe: send an email to <a moz-do-not-send="true"
              href="mailto:delphi-request@listserver.123.net.nz">delphi-request@listserver.123.net.nz</a>
            with Subject: unsubscribe<br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: <a class="moz-txt-link-abbreviated" href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a>
Admin: <a class="moz-txt-link-freetext" href="http://delphi.org.nz/mailman/listinfo/delphi">http://delphi.org.nz/mailman/listinfo/delphi</a>
Unsubscribe: send an email to <a class="moz-txt-link-abbreviated" href="mailto:delphi-request@listserver.123.net.nz">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <p class="" avgcert""="" color="#000000" align="left">No virus
        found in this message.<br>
        Checked by AVG - <a moz-do-not-send="true"
          href="http://www.avg.com">www.avg.com</a><br>
        Version: 2014.0.4716 / Virus Database: 3986/7813 - Release Date:
        07/07/14</p>
    </blockquote>
    <br>
  </body>
</html>