API - read only? #6822
-
I would like to add a donor via the API. Is this possible or is it only for getting information from the database? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hi @craig02445, If you are looking to programmatically add donors to the database using GiveWP, then yes, it is possible. GiveWP provides a Donor model designed for this purpose. The Donor model represents a donor entity and offers methods for creating, updating, and retrieving donor information. To add a new donor using the Donor model, you can utilize the create() method. This method allows you to create a new donor by providing the necessary attributes as an array. Here's an example of how you might use the donor model to create a new donor:
|
Beta Was this translation helpful? Give feedback.
-
Yes, I am doing that now. Can I do it via REST or whatever via a url?
On Wed, Jun 7, 2023 at 11:11 AM Joshua Dinh ***@***.***> wrote:
Hi @craig02445 <https://github.com/craig02445>,
If you are looking to programmatically add donors to the database using
GiveWP, then yes, it is possible. GiveWP provides a Donor model designed
for this purpose. The Donor model represents a donor entity and offers
methods for creating, updating, and retrieving donor information.
To add a new donor using the Donor model, you can utilize the create()
method. This method allows you to create a new donor by providing the
necessary attributes as an array. Here's an example of how you might use
the donor model to create a new donor:
use Give\Donors\Models\Donor;
// Create a new donor
$attributes = [
'firstName' => 'John',
'lastName' => 'Doe'
'email' => ***@***.******@***.***)',
// Other donor attributes...
];
$donor = Donor::create($attributes);
—
Reply to this email directly, view it on GitHub
<#6822 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHKHBZA4FZGMQ7P2DSURIPTXKCKZZANCNFSM6AAAAAAY46XLKY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Craig Haller, Advocate
Haller Advocacy
617.435.1759
Fax: 617.383.5245
SPEDadvocate.com
|
Beta Was this translation helpful? Give feedback.
-
Thank you!
-Craig
…On Wed, Jun 7, 2023 at 12:43 PM Joshua Dinh ***@***.***> wrote:
I see this may be a related to #6814
<#6814>.
If you are considering utilizing our REST API endpoints, please note that
they currently support requests related to listing and deleting donors. If
you need to add donors through a URL or RESTful API, you may have to
implement a customized solution or endpoint within your WordPress
installation to handle the donor creation process.
—
Reply to this email directly, view it on GitHub
<#6822 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHKHBZBCGRRIQ6KTCOKGKIDXKCVS7ANCNFSM6AAAAAAY46XLKY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Craig Haller, Special Education Advocate
Haller Advocacy
617.435.1759
Fax: 617.738.8197
SPEDadvocate.com <http://spedadvocate.com/>
|
Beta Was this translation helpful? Give feedback.
I see this may be a related to #6814.
If you are considering utilizing our REST API endpoints, please note that they currently support requests related to listing and deleting donors. If you need to add donors through a URL or RESTful API, you may have to implement a customized solution or custom endpoint within your WordPress installation to handle the donor creation process.