We're thrilled to see all the great development going on with the NationBuilder API, and want to open this forum up for public feedback, helps and hints, questions and more. This resource is curated by the NationBuilder API Team - our goal is developers helping developers, so we definitely want to hear from you. You can also use the tags to rank posts. Thanks!
Please add Petitions and Petition Signatures to the NationBuilder API
This would be very powerful for a bunch of existing integrations as well as new ones. For example, it would enable a service like CallHub to support members signing petitions via SMS. It would enable email your MP tools to track against petition pages directly within NationBuilder. It would also enable tools to report on a nation's core activities and track successes across a great range of actions.
Ideally, it would allow developers of external tools to work with NationBuilder's petitions as well as petition signatures, in the same way that we can already work with events and RSVPs (that event resource provides the best analogy).
I would say the key components would be:
- Index endpoint (to return all petitions per site)
- Create endpoint (create a new petition)
- Show/update/delete endpoints (these are less important to us, but useful all the same :)
- Petition signature Count endpoint (return the number of people who have signed a given petition)
- Petition signature Index endpoint (return the NationBuilder IDs, first names and emails of everyone who has signed a given petition)
- Petition signature Create endpoint (add a new signatory to a given petition)
Thanks for considering!
considering
Thanks CodeNation! I'll move this over to the API forum for that team to take a look at! There isn't a timeline on this at the moment but definitely a good suggestion.
Request Followups API
Would like an API to access followups set for a person (or all persons) and assigned to a user (or any user).
Theme API to Support Easy Theme Creation / Updates
zapier.com Integrations
Do you support integration using Zapier.com? This would be very helpful as it supports hundreds of different integrations in one package. Thanks!
[API] Relationships between People to People/Organizations are not available
We are not able to add relationships either between people with each other or with an organization through the API provided by NationBuilder.
We are trying to add various types of users on NationBuilder, such as adding a student and a school. However, we want to assign that a particular student has the relation "Student At" his/her school. This assignment is not available as the current API version does not support the endpoint "Relationships".
Is there a solution to set these relationships?
Thanks
Mohamed Hisham
Bug tracker
I think NB needs a bug tracker. Is there one I'm missing. Currently, we report bugs via point people or by developer email addresses that we happen to have. This system does not work for a variety of reasons.
I've reported many bugs via point people, and mostly they are misunderstood or ignored. I am sitting on about a dozen low or medium priority bugs that I'd happy report, but since I can only do so through point people I only report major, show-stopping bugs. And even then they usually don't get through to the engineers until I start squeaking.
A professional bug tracker that the engineering team can directly access, without point people as gate keepers, is important.
completed
If you're experiencing a bug, please contact our support team at [email protected] and follow these steps for reporting your bug.
Thanks!
People/search endpoint only returns exact matches
When I hit the search endpoint for a name, for example, I have to use the exact name to return a result. For example, if I search for first_name=brad it won't return results for 'Bradley'.
In addition, searching for names of organizations doesn't return results at all.
considering
This issue has been confirmed but does not have a set timeline on when it will be fixed. Please follow this cards if you would like to receive email updates about the status of this issue.
When will API and web hooks be updated to reflect the new paths?
What is the status on webhooks/api access to paths?
New "upgrade" killing off the Developers?
According to http://nationbuilder.com/feature_comparison , it looks like the Developer API is only going to be available on plans starting at a thousand dollars a month now? This effectively kills off the developer market entirely.
Was this intended? The Developer API was one of the main reasons I came to NationBuilder, and I keep my community hosted here. It's also been a huge reason for me to promote NationBuilder as an option amongst other non-profits, but the new pricing effectively destroys the potential of usage by most non-profits...
Is there any form of the API being left in the lower tiered plans?
-Reed
completed
It is true that nations on the Leader and Organization package will not have access to the API. Nations on any package can still install apps and hire a certified developer from our developer directory to build an integration with other systems using our API. The only restriction for nations on the Leader and Organization package is for them accessing the API to build a custom integration using non-certified developers.
Becoming a certified developer or publishing an app in our app directory will allow you to work with any customer regardless of the pricing package they are on. To become a certified developer please fill out this form and we'll be in touch shortly. To publish an app to our app directory please contact me directly at [email protected].
Using the API from "pure" Javascript
I'd like to call into the API from within some JavaScript code, purely running in the browser.
How can you authenticate safely if you want to use the API purely on a client side application? Many APIs allow you to restrict a token to a single or set of referrers (so they only work on sites under certain domains). Is there a similar mechanism within NationBuilder's API?
Posting Financial Transactions
Would be great if the Donations API could be opened up to read/write or that the Invoicing function be added as a read/write API so that we're able to post different types of transactions info.
For instance, an e-commerce solution could post customer sales back to the Nation either as a donation using a tracking code or by generating and closing an invoice.
completed
We've opened up write access to nearly all the donation fields. You can find the docs on our main page, and you can also view the NationBuilder Donations API on Github here.
Civicrm synchronisation
Has anyone already written code to synchronise People data between NationBuilder and a Civicrm site, using the two APIs?
We need to do that between our existing membership database and our NationBuilder site. I'd be interested to hear of any experiences from those who have already tried to do that.
Request Date Field in Contacts API
As noted else where in support, Contacts apparently default to date the contact was entered, and don't allow option to edit date to that on which contact actually occurred. This, ought to be fixed generally, and the option to edit the date added to the Contacts API
Survey API endpoints
Is the survey aspect of the API live? When I try to update survey questions I get this response back:
{
"code":"not_found",
"message":"Record not found"
}
I am using this json to pass it through:
{
"survey_response": {
"survey_id": 1,
"person_id": 2,
"question_responses": [{
"question_id": 2,
"response": 1
}, {
"question_id": 1,
"response": "yes"
}, {
"question_id": 3,
"response": "cool"
}]
}
}
Including Paths in the API
Hi,
It would be a huge help if paths and steps were included in the API. Then we could automate much more of the importing and tracking that we do. The feature has been out for a while and it seems intuitive that the feature would be included in the API. Thanks so much!
Jenny Landon
Represent.Us
completed
Jenny,
We now have a paths API with the ability to index paths and steps. Please see the documentation.
Is there any way to ajax submit a form in NationBuilder?
considering
This is not possible with our current page infrastructure.
Recording Pledge Data via the API
I'm working for a non-profit that is running a pledge drive, and has pledge form on its website. Is there any way we can move pledge data into NationBuilder via the API? I don't see pledges referenced anywhere in the documentation.
Request an Activity Stream API
I would like an API to access the Activity Stream, as the Contacts API is only showing a portion of the communications relevant to a person. My present objective is simply to access the same information as is shown in the People dashboard in read only format.
Feature Request: get and add People relationships
It would be great to see the ability via the API to get any existing relationships a person has and add new ones, as you can do via the GUI.
considering
This is something we will consider but does not have a timeline at the moment.
email api?
Any thoughts on an email API that could help supporters recruit others? For example, I want to start a recruiting drive where each supporter recruits at least two others. I'd like to create an app that allows people to enter a few emails, use default/editable text, and send emails out right from the page on their behalf.
submitted
Great suggestion, Bruce. We do intent to expose more communications features in the API - however, we don't presently have a timeline for this and have quite a lot of new features planned before communications. You may want to look into SendGrid's API, which we use for our mail services - you could build an email app using their tools and log new people and contacts back into NationBuilder using our existing calls.
Using API in PHP for email sign up form; how to activate/verify email address?
I've got a script working nicely where a user visiting a WordPress site can fill out their name and email address, check the opt-in box, and sign up to a list on NationBuilder. But I can't seem to find any information on how to have NationBuilder send a verification email or double opt-in message to the new user to confirm that the email is valid and they do really truly want to be on this list. How would we go about this using the API?
Get notes on person's profile via the API
With the current People API you can add a note to a person's profile which is great! However, it would be fantastic if you could also get those notes too via the API.
considering
This is something we will consider but does not have a timeline at the moment.
POST/PUT endpoints do not work.
I'm using the NB api via PHP. The GET/DELETE methods both work but no matter what I try I can not edit or add a new people resource using the client->fetch() function.
The error code is always a 400 no matter how I format the parameters. Please help and don't give me a canned response to the API helper because I've spent 3.5 hours already trying various things in the documentation which is thin to say the least.
Suggestion: Address fields as parameters on the people/search endpoint.
At the moment, you can GET people/search with geographical filters City and State. It would be nice to able to also filter (for instance) on Address 1, or Street Number, Name, and Type, or ZIP. (ie. we would like to see more geographical / primary address filters exposed through the API.)
considering
This is something we will consider but does not have a timeline at the moment.
API bulk tag removal
I'm having problems with the bulk tag removal API. For example, using the API explorer for my nation I send the following:
DELETE | Bulk Tag Removal|
/people/:id/taggings with id = 123 and body:
{ "tagging": { "tag": ["hello"] } }
I get response code: 400 { "code":"missing_parameters","message":"Missing Parameters.","parameters":["tagging"]}
In contrast, the API for adding tags works as expected. This has exactly the same syntax except the request is a PUT not a DELETE.
completed
This bug has been fixed.
Webhooks do not immediately trigger when adding a tag
When adding a tag to someone in your database, the 'person changed' webhook will not fire until you save that profile or a different profile in the database. This makes syncing tags with an external database a challenge.
People Credentials
I mean, is it possible that people from my nation logs in my app with their nationbuilder credentials (user and password)?
Comments API
Any chance we’ll see access to the Page Comments API in the near future? I’d love to be able to leverage Disqus comments without sacrificing the value of the native comment platform (i.e., creating new signup records and appending comment information to existing ones).
People Create Endpoint and PHP.
App Integration Leading Practices?
I'll frame this question in a general way so it applies to other 3rd party app developers, not just me:
What level of API integration are NB customers asking for?
For example, if you build a third-party app that can help members of a nation interact with each other (i.e. group chat or something else), there are several ways I can imagine that you'd want to integrate it with NB, each with a different level of complexity:
- No integration: Just listing an app in the app directory, essentially as an ad for the app-- probably not an option.
- Minimal integration: Include the app in an iframe and have either no sign-in requirement or require that the members of the nation sign in a second time within the app's iframe as part of the app's authentication process.
- Deep integration: Connect to the People API so that members of a nation can sign into your app from within a NB page for that nation.
- Other options?
Are any of those options emerging as common or recommended?
What are NB customer expectations around 3rd party app integration? I don't expect they'd be too happy with requiring that the members of their nation sign in twice-- once to NB and once to the app. That's what I found with one client I worked with.
Thanks!
When Installing Field Edge app it disappears from my Control Panel
When I install Field Edge it doesn't appear in Installed Apps or in the app listing. This makes me concerned it's not installed.
submitted
We are investigating why FieldEdge doesn't show up under 'Installed Apps.' After testing the integration, it is clear that FieldEdge is syncing with the nation so functionality is not limited due to this issue.
How does one create a sub page of a page through the API
There doesn't seem to be a way to either create pages as sub pages through the api or to attach existing pages to other pages as sub-pages.
Any help would be appreciated.
Thanks,
Steve
submitted
Steve, parent/child page relationships are not presently represented in the API. We'll review adding those parameters.
Imports via API incorrectly allocating records as prospects
I have imported a number of records via the API, which all have an email address and email_opt_in='Y', but the
records are being imported as PROSPECTS. Whereas http://nationbuilder.com/how_support_status_is_determined says:
"Records imported with:
* support level = 1
* support level = 2
* email address and email opt-in = Y
* mobile number and mobile opt-in = Y
will always be supporters."
considering
This issue has been confirmed but does not have a set timeline on when it will be fixed. Please follow this cards if you would like to receive email updates about the status of this issue.
PUT to people API via PHP
When i do something link this in PHP:
$params = array(
'person' => array(
'email' => '[email protected]','home_address' => array('country' => 'Germany', 'zip' => '66666' ))
);
$header = array('Authorization:' => $token,'Content-Type:' => 'application/json', 'Accept:' => 'application/json');
$response = $client->fetch($baseApiUrl . '/api/v1/people/push?access_token=myaccesstoken', $params, 'PUT',$header);
print_r($response);
i get the following response
Array
(
[result] => Array
(
[code] => missing_parameters
[message] => Missing Parameters.
[parameters] => Array
(
[0] => person
)
[inner_error] => Array
(
[name] => Api::Error::MissingParameters
[message] => Missing parameters: person
)
)
[code] => 400
[content_type] => application/json
)
Whats wrong with the Parameters? Do i need to add something else to the Params?
submitted
Alexander, I sent you an email with a proposed solution; let me know if that works for you.
thanks, Arion Hardison
Does access_token expire? oauth/token response includes "expires_in" attribute
In some tests I noticed that responses from /oauth/token have the attribute "expires_in". This attribute isn't included in the quick start guide example response, and a colleague found an article about access_tokens no longer expiring. Anyone have more information about this topic?
completed
D B - What Alex is referring to in his previous comment is that tokens no longer expire until they are manually revoked through the nation's control panel.
Deleted/Merged webhook
This is needed to ensure proper cotnact synchronization between an external database and NationBuilder. You can delete from NB, but no webhook fires when data is removed or merged.
Exports API for a Nation
There is an Exports API for a specific list. (POST /api/v1/lists/:list_id/exports). Is there an API to export all people from a nation?
Issue with PUT'ing to people via API with PHP
Hi,
We're using the NB people API with PHP and the adoy/oauth2 library. Recently, whenever our site makes a PUT to /api/v1/people/push, we seem to be receiving a code 400 error with no message attached.
Code:
$payload = array(
'person' => array(
'first_name' => $first_name,
'last_name' => $last_name,
'email' => $email,
'note' => 'Sign up from web form at ' . DB::now(),
'email_opt_in' => true
)
);
$api_url = $baseApiUrl . '/api/v1/people/push';
$response = $client->fetch($api_url, $payload, 'PUT', array('Content-type' => 'application/json', 'Accept' => 'application/json'));
The response comes through like this:
(
[result] =>
[code] => 400
[content_type] => text/plain; charset=utf-8
)
Can anyone point me in the direction of what isn't right here?
Thanks,
Sam
People Search Api not showing results
hi,
I am new to using the nation builder api. I have added multiple contacts to my account and trying to search on them using various fields. But I am unable to get the results.
The following person exists in my contacts and i can get it when I use first_name and last_name in the search parameters, but If i use city or state i am unable to get results.
https://slugName.nationbuilder.com/api/v1/people/search?first_name=Jennifer&last_name=Rolle
primary_address: {
completed
Hi Ella,
There was an issue with people#search
where instead of searching the primary address, the home address of people was searched instead (people in NationBuilder can have up to 7 different addresses, more on that here - including how to set primary address for a person). This explains why you weren't seeing results through the API as your nation didn't have any home addresses that matched what you were searching for.
A fix was pushed out today, and searching city
or state
through people#search
should now return results that match based on the primary addresses of folks in your nation.
Best,
Alex
Looking for the "right" way to hook into the form submission API
Hi folks, we'd like to add some JS actions—adding content to fields—to an NationBuilder form on submit before the form validation/send is triggered. However binding on the form submit handler triggers after the NationBuilder actions and the data is not captured.
Is there an elegant/sanctioned way to hook into the event dispatcher? Essentially I need a callback before the form submits though NationBuilder XHR channels. Someone has a gist of how to do this, but the timing of this isn't correct (form still submits).
List
Would love to see the API access lists
completed
You got it! http://nationbuilder.com/lists_api
Fields that can be mapped to NationBuilder from 123contactform
I've been using the new 123contactform integration and it is fantastic! But...it seems to be missing some standard fields that are available in the people/edit page on NB.
From 123contactform you can map to home, meetup (what is this? it doesn't seem to exist on the NB side), billing, and mailing addresses, but there is no work address available.
Also, the primary address is there, but according to other posts I've seen, the primary designation is set to whatever address gets populated first. When mapping from 123contactform to NB on the primary address fields, it doesn't populate because of that.
There is also no work phone available.
Can you make work phone, work address, and website available in the integration?
Accessing blog posts of deleted blog
Hello,
When deleting a blog, the blog posts themselves are not deleted and can still be viewed on the site by their URL and found via search. How do we use the NationBuilder API to access blog posts of a deleted blog? All of the blog post methods require a blog ID.
not planned
Jonathan,
Thanks for bringing this to our attention. After testing this it is clear that deleting the blog post is difficult after deleting the blog if you don't have the blog_id because the ability to index blog pages goes away when you delete the page. It is possible to delete the posts through the control panel. To do this, please go to your nation's control panel and select the Website tab and then toggle the drop down for 'page type' to 'blog post.' Once here you should see all blog posts including the posts that were subpages of the blog page you deleted and can choose to delete the posts here.
Is Theme Sync dead?
Used it quite a bit 2 years ago to great effect. Now it loops between choose site page and back to login page. Choosing a site seems to log me back out.
Still working for other people?
started
Jedd,
ThemeSync still works and I recommend uninstalling/reinstalling it to get past the hiccup you're experiencing. Also, we have started working on a different solution that utilizes a Dropbox integration.
Extend tags API to include tag counts
Right now, the only way to find out how many people are tagged with a specific tag in your nation, via the API, is to call the people method, which returns a paginated list of people with that tag. You then have to go through every page, incrementing the counter for every person. Needless to say this involves a fair few API calls for large tags.
There's already a tag index where you can see a list of tags - we just need that index to include a number too.
considering
This is something we will consider but does not have a timeline at the moment.
However we are paying close attention to the most popular suggestions so please share and encourage others to follow and comment!
Donation Synchronization, and Donation Search Endpoint
For my organization's use case, we need a synchronization of all donation records, in order to produce financial reports, and for other uses. This requires high reliability of the synchronization process.
- Webhooks provide a synchronization potential with the downside that, like webhooks of other internet-based services, there is almost no feedback about webhook invocation failures. This makes not meet the requirements of our use case.
- Querying the table of donation records as a replacement, or a verification procedure, of the webhook method would be workable. However, since donations do not currently provide a search endpoint with an "updated_since" parameter, this creates the problem of having to download the whole donation table each time a synchronization is required. This limitation makes the method virtually unusable for production employment in our use case.
Could you lift any of these limitations, or is there another way to solve this problem. Again, we have the legal necessity of not missing any records, or misrepresenting any record fields.
Thanks,
--
Pav
I get a 500 error when trying to add a page attachment to a blog
When I hit the following url:
https://mysitename.nationbuilder.com/api/v1/sites/mysitename/pages/blog/attachments?access_token=mytoken
with the data:
{"attachment":{"filename":"flower-tiny.jpg","content_type":"image/jpeg","content":"/9j/4AAQSkZJRgABAQEASABIAAD/4QBARXhpZgAATU0AKgAAAAgAAYdpAAQA\nAAABAAAAGgAAAAAAAqACAAQAAAABAAAADKADAAQAAAABAAAADAAAAAD/2wBD\nAAEBAQEBAQEBAQEBAQEBAgMCAgICAgMCAwIDBAMEBAQDBAQEBQYFBAUGBQQE\nBQcGBgYHBwcHBAUICAgHCAYHBwf/2wBDAQEBAQIBAgMCAgMHBQQFBwcHBwcH\nBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwf/\nwAARCAAMAAwDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQF\nBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJx\nFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdI\nSUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKj\npKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx\n8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QA\ntREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHB\nCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldY\nWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmq\nsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6\n/9oADAMBAAIRAxEAPwD5/wD+CUf/AAS4/wCCd3xc/Ym+FHjPxj8L/G3xj+M/\nxomsLPVneyj1SXQJLuW4iF8EjdFtNNhGTJM25xhSc7QB/ON/wVV/Yag/Ys/b\nB8X/AAh8NadeaZ4TvbG31rSYGZ7oR2s7yxgLIwBdS0DkZ6ZK5O2vPf2SP+Cj\n37Uv7HnhrxV4Y+CnivSNM0/XIiu69sheSWYw5IgYsPLBbaxHIJRcjHB+VPjL\n8dPiv+0B8QNa+KHxd8a6x4y8ba8V+0Xlw+07V+7GqrhUUZOAAByT1JNeFjci\nxeT18HQyvHSlhGqlSsq8Yzqyqza5VCpHltSpWnGMbK8XC65ouT+yzzD08Vle\nAxNTESdSPNBQjTpwhbTmcmm5Tle1m0t5O+tj/9k=\n","updated_at":"2014-01-03T11:19:23-06:00"}}
I get a 500 error. Any way I can get this to work?
Thanks,
Steve
submitted
It may be that you don't have a page with the slug "blog" on your site. The Page Attachments API POST endpoint is looking for a slug, not a page type. If you need more help on this issue, please email [email protected]. Thank you!
Custom Fields list API method needed.
I think a new method is needed to list a nations custom fields and their types. For instance by only being able to view a custom field on a person I am unable to tell the difference between a text and a multiple choice field.
Also I am unable to infer the possible options for a multiple choice field if there is no person with that option.
considering
This is something we will consider but does not have a timeline at the moment.
Set address used as primary address
Using the API, how can I update which address is currently used as the primary address? e.g. mailing, home, billing, ... It would also make sense if the person object included which address is currently set as the primary address. This is helpful to know which address to update.
submitted
It isn't possible to change which address is the primary address via the API. If it is not set manually in the control panel, the primary address is set automatically to the first present address in this hierarchy:
1. home
2. registered
3. billing
4. work
5. mailing
6. user-submitted
7. Twitter
If you wish a different address to be the primary for a group of records, you would need to run a batch update in the control panel.
Add feature to list all people on a step through API
We have received reports that users may find it helpful to list all people on a specific step within a specific path using our API. Currently, we offer the ability to index paths and search people, but not the ability to search people on a specific path or step.
submitted
Thanks Alex! I'm going to scoot this over to our API forum for that team to take a look at!