# Sending an api request in a plugin

**URL:** https://meta.discourse.org/t/sending-an-api-request-in-a-plugin/374928
**Category:** Development
**Created:** [July 20, 2025, 2:56am UTC](https://meta.discourse.org/t/sending-an-api-request-in-a-plugin/374928 "2025-07-20T02:56:56Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [July 20, 2025, 2:56am UTC](https://meta.discourse.org/t/sending-an-api-request-in-a-plugin/374928/1 "2025-07-20T02:56:57Z")

</div>

How can I send an API request in a plugin, e.g. to change a user’s data? Preferably, with no need to specify an API key?  
Thanks.

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [July 20, 2025, 3:02am UTC](https://meta.discourse.org/t/sending-an-api-request-in-a-plugin/374928/2 "2025-07-20T03:02:55Z")

</div>

Or, is there a way to _not_ use requests to URLs, instead using built-in classes or methods (e.g. PostCreator)?

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [July 20, 2025, 6:50am UTC](https://meta.discourse.org/t/sending-an-api-request-in-a-plugin/374928/3 "2025-07-20T06:50:14Z")

</div>

> [@NateDhaliwal](#):
>
> to change a user’s data?

Read up about MVC.

> **[Getting Started with Rails — Ruby on Rails Guides](https://guides.rubyonrails.org/getting_started.html)**
>
> This guide covers getting up and running with Ruby on Rails.After reading this guide, you will know: How to install Rails, create a new Rails application, and connect your application to a database. The general layout of a Rails application. The...

Requests → Controllers → Models

Use the Rails Models.

Experiment on the rails console using models.

eg

```plaintext
rails c
user = User.find_by(username: "harry")
user.username = "george"
user.save!
user.username

```

etc etc.

This is the very basics of code that is placed in plugins.

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [July 20, 2025, 8:04am UTC](https://meta.discourse.org/t/sending-an-api-request-in-a-plugin/374928/4 "2025-07-20T08:04:26Z")

</div>

Thanks! This seems like what I’m looking for; I’ll take a look.
