Skip to content

Commit

Permalink
Nirs actionnetwork changes (move-coop#940)
Browse files Browse the repository at this point in the history
* working on adding a functio to an and took care of a lint issues

* init

* working on all get functions

* actionnetwork functions batch 1 is ready

* linting and black formatted compliance

* removed unwanted/unsused lines

* merged updated main

* did some linting

* added some more get functions to support all ActionNetwork objects (Advocacy Campaigns, Attendances, Campaigns, Custom Fields, Donations, Embeds, Event Campaigns, Events, Forms, Fundraising Pages, Items, Lists, Messages, Metadata, Outreaches, People, Petitions, Queries, Signatures, Submissions, Tags, Taggings, Wrappers)

* worked on linting again

* unstashed changes after merging main and progressing with more POST and PUT funcs

* getting ready to release update and create functions

* getting ready to release update and create functions

* linting

* linting

* added code I overrided by accident

* worked on feedback (added Documentation Reference in docstring foreach function in module)
  • Loading branch information
NirTatcher authored Jan 8, 2024
1 parent 8d30779 commit af8744d
Show file tree
Hide file tree
Showing 3 changed files with 1,014 additions and 6 deletions.
56 changes: 56 additions & 0 deletions docs/action_network.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,62 @@ You can then call various endpoints:
# Update a person
an.update_person('fake_id', given_name='new_given_name', tags=['tag_1', 'tag_2'])
# Get all taggings associated with a specific tag
all_taggings = an.get_taggings('tag_id')
# Get a specific tagging
specific_tagging = an.get_tagging('tag_id', 'tagging_id')
# Create a tagging
tagging_payload = {
"_links" : {
"osdi:person" : { "href" : "https://actionnetwork.org/api/v2/people/123" }
}
}
created_tagging = an.create_tagging('tag_id', tagging_payload)
# Result
created_tagging = {
"_links": {
"self": {
"href": "https://actionnetwork.org/api/v2/tags/123/taggings/123"
},
"osdi:tag": {
"href": "https://actionnetwork.org/api/v2/tags/123"
},
"osdi:person": {
"href": "https://actionnetwork.org/api/v2/people/123"
},
"curies": [
{
"name": "osdi",
"href": "https://actionnetwork.org/docs/v2/{rel}",
"templated": true
},
{
"name": "action_network",
"href": "https://actionnetwork.org/docs/v2/{rel}",
"templated": true
}
]
},
"identifiers": [
"action_network:123"
],
"created_date": "2014-03-18T22:25:31Z",
"modified_date": "2014-03-18T22:25:38Z",
"item_type": "osdi:person"
}
# Delete a tagging
an.delete_tagging('tag_id', 'tagging_id')
# Get all wrappers
all_wrappers = an.get_wrappers()
# Get a specific wrapper
specific_wrapper = an.get_wrapper('wrapper_id')
***
API
***
Expand Down
Loading

0 comments on commit af8744d

Please sign in to comment.