Answers.Body: <p>Extention is probably the best and right way to do it : I have seen that the API is able to get the Contact Id.</p>
  
  <p>I have to learn how to make an Extension.</p>
  
  <p>Thanks to all of you for your answers</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-06T07:30:46.050Z
Answers.LastActivityDate: 2016-07-06T07:30:46.050Z
Answers.UserDisplayName: Jacques-Marie Moranne
Answers.Body: <p>Another is convert your external program to an extension, then make api calls.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-03T20:20:27.873Z
Answers.LastActivityDate: 2016-07-03T20:20:27.873Z
Answers.UserDisplayName: Demerit
Answers.Body: <p>If you developed an external program I would highly recommend you to put this in a CiviCRM extension. How are you accessing your program? You could easily add a button or link to the page with your extension which then includes the contact_id?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-04T06:24:36.540Z
Answers.LastActivityDate: 2016-07-04T06:24:36.540Z
Answers.UserDisplayName: ErikH - CiviCooP
Answers.Body: <p>One way is use a drupal view with a field with the link in it since you can access user id from view fields. Make it a block if you need it to be on a specific page.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-04T06:47:29.840Z
Answers.Text: Agreed. and if you were going this route, you could even have Views produce the PDF but that isn't what the question asks about, but just noting here for posterity
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-03T20:18:12.940Z
Answers.LastActivityDate: 2016-07-03T20:18:12.940Z
Answers.UserDisplayName: Demerit
Body: <p>I have developped an external php program to generate a customized contact data-sheet (pdf).</p>
  
  <p>This program must be run from a Civi Page via an URL which requires the current Contact_id as an argument, in the following way : </p>
  
  <p><a href="https://www.mysite.com/fpdf/myprogram.php?contact=" rel="nofollow">https://www.mysite.com/fpdf/myprogram.php?contact=</a><strong><em>current contact id</em></strong></p>
  
  <p>How can I get and must I parameterize this <strong><em>current contact id</em></strong> ?</p>
  
  <p>As an alternative, I could use the Current Drupal User-Id instead of the Civi Contact-Id (the user is supposed to be authenticated, and I know how to convert user to contact)</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-07-03T23:16:52.110Z
Comments.Text: Possible duplicate of [Get current contact id?](http://civicrm.stackexchange.com/questions/3840/get-current-contact-id)
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-07-06T07:33:37.407Z
Comments.Text: Not really a duplicate (I had seen this question) : rather complementary
Comments.UserDisplayName: Jacques-Marie Moranne
Tags: <contacts><urls>
Title: Contact id as an URL Argument?
ThreadText: # Contact id as an URL Argument?
  
  (Asked by: username_0 on 2016-07-03)
  
  I have developped an external php program to generate a customized contact data-sheet (pdf).
  
  This program must be run from a Civi Page via an URL which requires the current Contact\_id as an argument, in the following way :
  
  <https://www.mysite.com/fpdf/myprogram.php?contact=>***current contact id***
  
  How can I get and must I parameterize this ***current contact id*** ?
  
  As an alternative, I could use the Current Drupal User-Id instead of the Civi Contact-Id (the user is supposed to be authenticated, and I know how to convert user to contact)
  
  **Tags:** contacts, urls
  
  > **Comments:**
  > **username_1**: Possible duplicate of [Get current contact id?](http://civicrm.stackexchange.com/questions/3840/get-current-contact-id)  
  > **username_0**: Not really a duplicate (I had seen this question) : rather complementary  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_0 on 2016-07-06. Score: 1 | Accepted answer
  
  Extention is probably the best and right way to do it : I have seen that the API is able to get the Contact Id.
  
  I have to learn how to make an Extension.
  
  Thanks to all of you for your answers
  
  
  ---
  
  ### Answer by username_2 on 2016-07-03. Score: 1
  
  Another is convert your external program to an extension, then make api calls.
  
  
  ---
  
  ### Answer by username_3 on 2016-07-04. Score: 0
  
  If you developed an external program I would highly recommend you to put this in a CiviCRM extension. How are you accessing your program? You could easily add a button or link to the page with your extension which then includes the contact\_id?
  
  
  ---
  
  ### Answer by username_2 on 2016-07-03. Score: 0
  
  One way is use a drupal view with a field with the link in it since you can access user id from view fields. Make it a block if you need it to be on a specific page.
  
  > **Comments:**
  > **username_4**: Agreed. and if you were going this route, you could even have Views produce the PDF but that isn't what the question asks about, but just noting here for posterity  
  
  ---
  
  