Answers.Body: <p>There isn't any option in the API to generate registration link, the code you are using should create the correct link</p>
  <pre><code> $id = $event['id'];
   $reglink = CRM_Utils_System::url('civicrm/event/register', &quot;reset=1&amp;id={$id}&quot;);
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-30T15:29:21.003Z
Answers.Text: Ok. Thank you. I assumed this utility would be replaced by some call to the API, but if this still valid, I will stick with it. Thank you.
Answers.UserDisplayName: Paul Dufresne
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-30T14:48:09.410Z
Answers.LastActivityDate: 2023-01-30T14:48:09.410Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>I'm retrieving event details for a plugin, and thanks to some help here, I am now using the correct API to access the information. However, I am currently using the following to generate a registration link for an event, but I'd like to do the same using APIv4. I've searched the API reference and the API Explorer, with no luck.</p>
  <pre><code>        $id = $event['id'];
          $reglink = CRM_Utils_System::url( 'civicrm/event/register', &quot;reset=1&amp;id=$id&quot; );
  </code></pre>
  
Tags: <civievent><urls><apiv4>
Title: retrieve event registration link with api v4
ThreadText: # retrieve event registration link with api v4
  
  (Asked by: username_0 on 2023-01-30)
  
  I'm retrieving event details for a plugin, and thanks to some help here, I am now using the correct API to access the information. However, I am currently using the following to generate a registration link for an event, but I'd like to do the same using APIv4. I've searched the API reference and the API Explorer, with no luck.
          $id = $event['id'];
          $reglink = CRM_Utils_System::url( 'civicrm/event/register', "reset=1&id=$id" );
  
  **Tags:** civievent, urls, apiv4
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-01-30. Score: 1 | Accepted answer
  
  There isn't any option in the API to generate registration link, the code you are using should create the correct link
   $id = $event['id'];
   $reglink = CRM_Utils_System::url('civicrm/event/register', "reset=1&id={$id}");
  
  > **Comments:**
  > **username_0**: Ok. Thank you. I assumed this utility would be replaced by some call to the API, but if this still valid, I will stick with it. Thank you.  
  
  ---
  
  