title: Where do I find the IDs needed for Bot Framework?
body: <p>The IDs to use for Bot Framework are in most cases easy to find, because you receive them in the &quot;Activity&quot; object that is sent to the bot when the user initiates contact.</p>
  <p>However, I am trying to use the Create Conversation endpoint, which means I have to know the ID of the user and the bot.</p>
  <p><a href="https://docs.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-connector-api-reference?view=azure-bot-service-4.0#create-conversation" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-connector-api-reference?view=azure-bot-service-4.0#create-conversation</a></p>
  <p>A simplified request (that works!) like this:</p>
  <pre><code>{
  &quot;bot&quot;: {
      &quot;id&quot;: &quot;28:4a4f500c-4897-4eaf-a364-c67942f41f6f&quot;
  },
  &quot;members&quot;:[{
      &quot;id&quot;: &quot;29:1DUjC5z4ttsBQa0fX2O7B0IDu30R_6SfPMhwj-E1BwWmvYzb_IElqJwzPDocwPxTS0j8clYeb8gZx67V8TuChbA&quot;
  }],
  &quot;tenantId&quot;: &quot;c7392b95-d07b-4653-87a7-6c709f527c42&quot;
  }
  </code></pre>
  <p>I need to find the user id (member id) somehow, maybe through Graph API? Or maybe through the Bot Framework API? But how?</p>
  <p>Additionally, I'd like to be able to also programmatically find the Bot ID because I would be deploying this bot to many tenants and it would simplify the configuration a lot. However, where do I find the Bot ID, even manually? It doesn't look like it is the App Id from Azure or the Object id.</p>
  <p>(I understand the prefix of 28 and 29, so that is not related to my question)</p>
  <p><strong>UPDATE:</strong></p>
  <p>The key take aways from the accepted answer are the following:</p>
  <pre><code>The userId is unique to your bot ID and a particular user. You cannot reuse the userId between bots. The channelId is global.
  </code></pre>
  <p>This means I cannot hope to find the userId somewhere else and that is a very important piece of information.</p>
  <pre><code>When your app is installed in any particular context, you receive an onMembersAdded activity.
  </code></pre>
  <p>Apparently I can expect to receive a message in my bot even if the bot is just installed for a user. This would be my opportunity to find the userId.</p>
  <p>When I try this out, I will confirm here whether that indeed happens in my scenario, which is a bot in a Personal Tab.</p>