Answers.Body: <p>The example calls <code>$result = civicrm_api('UFMatch', 'get', $params);</code> to get the Drupal user id that it passes to <code>user_load()</code> to get the rest of the  user info.</p>
  
  <p>If you just want the id then it is the value being passed to <code>user_load()</code>: </p>
  
  <pre><code>$result['values'][0]['uf_id'])
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-30T10:21:46.807Z
Answers.Text: Thanks for the reply. Yes I got it immediately after posting the question. Sorry for not closing the question.
Answers.UserDisplayName: preethi
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-29T17:18:47.247Z
Answers.LastActivityDate: 2017-06-29T17:18:47.247Z
Answers.UserDisplayName: Aidan
Body: <p>In civicrm contact summary we see Contact ID / User ID, where User ID refers to the drupal. I will need to customize a token for this User Id which I am supposed to use in civimail. Here in this link <a href="https://wiki.civicrm.org/confluence/display/CRMDOC/Customized+%28and+Custom%29+Tokens" rel="nofollow noreferrer">https://wiki.civicrm.org/confluence/display/CRMDOC/Customized+%28and+Custom%29+Tokens</a> ,drupal username can be fetched. But I need it for Drupal Id. Please suggest.</p>
  
Tags: <civimail><tokens>
Title: Drupal User ID Token
ThreadText: # Drupal User ID Token
  
  (Asked by: username_0 on 2017-06-29)
  
  In civicrm contact summary we see Contact ID / User ID, where User ID refers to the drupal. I will need to customize a token for this User Id which I am supposed to use in civimail. Here in this link <https://wiki.civicrm.org/confluence/display/CRMDOC/Customized+%28and+Custom%29+Tokens> ,drupal username can be fetched. But I need it for Drupal Id. Please suggest.
  
  **Tags:** civimail, tokens
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-06-29. Score: 1 | Accepted answer
  
  The example calls $result = civicrm_api('UFMatch', 'get', $params); to get the Drupal user id that it passes to user_load() to get the rest of the  user info.
  If you just want the id then it is the value being passed to user_load(): 
  $result['values'][0]['uf_id'])
  
  > **Comments:**
  > **username_0**: Thanks for the reply. Yes I got it immediately after posting the question. Sorry for not closing the question.  
  
  ---
  
  