Create a petition
Changed onCreates a petition from given data
Request
- Base URLhttps://yournation.nationbuilder.com
- AuthHTTP bearer
Request body
Example request
{
"data": {
"type": "petitions",
"attributes": {
"additional_signatures_count": 10,
"auto_response_broadcaster_id": "1",
"auto_response_content": "Auto response content",
"auto_response_subject": "Auto response subject",
"content": "Petition content",
"goal": 5,
"intro": "Petition intro",
"page_id": "1",
"petition_form_address": "required",
"petition_form_phone": "optional",
"signature_name": "endorsement"
},
"relationships": {
"page": {
"data": {
"type": "pages",
"temp-id": "new-id",
"method": "create"
}
}
}
},
"included": [
{
"type": "pages",
"temp-id": "new-id",
"attributes": {
"site_id": "1",
"parent_id": "1",
"author_id": "1",
"external_id": "abc",
"slug": "your-slug",
"status": "unlisted",
"name": "Page Name",
"headline": "Page headline",
"title": "Page Title",
"excerpt": "Page excerpt...",
"page_type_name": "Petition",
"permission_level": "anyone"
}
}
]
}Response
The newly created petition.
Example response
{
"data": {
"id": "1",
"type": "petitions",
"attributes": {
"additional_signatures_count": 10,
"auto_response_broadcaster_id": "1",
"auto_response_content": "Auto response content",
"auto_response_subject": "Auto response subject",
"content": "Petition content",
"goal": 5,
"intro": "Petition intro",
"page_id": "1",
"petition_form_address": "required",
"petition_form_phone": "optional",
"signature_name": "endorsement"
}
},
"included": [
{
"type": "pages",
"id": "1",
"attributes": {
"site_id": "1",
"parent_id": "1",
"author_id": "1",
"external_id": "abc",
"slug": "your-slug",
"status": "unlisted",
"name": "Page Name",
"headline": "Page headline",
"title": "Page Title",
"excerpt": "Page excerpt...",
"page_type_name": "Petition",
"permission_level": "anyone",
"parent_slug": "blog",
"url_path": "/your-slug",
"published_at": "2019-10-26T10:00:00-04:00",
"ancestors_permission_level": "members",
"effective_permission_level": "control_panel_users"
},
"temp-id": "new-id"
}
]
}Changes
- breaking
added
subschema #2to the request bodyallOflist - breaking
the request's body type changed from
objectto no type - breaking
the response's body type changed from
objectto no type for status - breaking
removed the required property
from the response with the status - warning
removed the request property
- warning
removed the request property
- warning
removed the optional property
from the response with the status - info
added the media type
application/vnd.api+jsonto the request body - info
added
subschema #2to the response bodyallOflist for the response status - info
media type
application/jsonwas changed to a more specific media typeapplication/vnd.api+jsonfor the response status - info
added the non-success response with the status
- info
added the non-success response with the status
- info
added the non-success response with the status
- info
added the non-success response with the status
- breaking
- breaking
the request property
///became not nullable - breaking
the request property
///became not nullable - breaking
the request property
///became not nullable - breaking
the request property
///became not nullable - breaking
the
/request property type changed from no type toobject - warning
removed from the
/request propertyallOflist - info
added the new optional request property
// - info
added the new optional request property
// - info
added the new optional request property
// - info
added the new optional request property
// - info
added the new optional request property
// - info
added the new optional request property
// - info
added the new optional request property
// - info
added the new optional request property
// - info
added the new optional request property
// - info
added the new optional request property
// - info
added the new optional request property
// - info
added the new optional request property
// - info
added the new optional request property
// - info
added the new optional request property
/// - info
added the new optional request property
/// - info
added the optional property
//to the response with the status - info
added the optional property
///////to the response with the status - info
added the optional property
///////to the response with the status - info
added the optional property
///////to the response with the status - info
added the optional property
///////to the response with the status - info
added the optional property
///////to the response with the status
- breaking