Skip to content

Commit

Permalink
Examples for creating signatures and attendees via API (#146)
Browse files Browse the repository at this point in the history
* Add example for creating a signature, and update the example for creating an attendee via the API to make clearer how to do it

* Use a phone number with the correct format on examples
  • Loading branch information
anero authored May 31, 2024
1 parent 6ea3086 commit 20fda7b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
8 changes: 4 additions & 4 deletions source/includes/authenticated_api/_attendees.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ Find an attendee by email address. Once you have obtained the attendee's id you
},
"data_processing_consent_type": "explicit",
"email_opt_in_type": {
"context": "web_form",
"kind": "radio_sure",
"context": "external",
"kind": "external",
"mailable": true,
"external_id": null,
"active": true
"external_id": "canvass-signature-2022",
"active": false
},
"member": {
"id": 1124,
Expand Down
30 changes: 23 additions & 7 deletions source/includes/authenticated_api/_signatures.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ was recorded against.
"first_name": "Foo",
"join_organisation": true,
"last_name": "Bar",
"phone_number": "123-456",
"phone_number": "555-555-5555",
"postcode": "10010",
"source": "",
"token": "abcDEFghi123456789jklMNO",
Expand Down Expand Up @@ -132,6 +132,22 @@ The JSON response has a single "signature" object, which may include the followi
<div></div>

### Create
> POST /api/v1/petitions/no-taxes-on-tea/signatures/

```json
{
"signature": {
"first_name": "Foo",
"last_name": "Bar",
"email": "[email protected]",
"postcode": "10010",
"phone_number": "555-555-5555",
"country": "US",
"email_opt_in_type_external_id": "abcd12345",
"join_organisation": true
}
}
```

> Response body

Expand All @@ -156,7 +172,7 @@ The JSON response has a single "signature" object, which may include the followi
"first_name": "Foo",
"join_organisation": true,
"last_name": "Bar",
"phone_number": "123-456",
"phone_number": "555-555-5555",
"postcode": "10010",
"source": "",
"token": "abcDEFghi123456789jklMNO",
Expand All @@ -171,11 +187,11 @@ The JSON response has a single "signature" object, which may include the followi
"data_processing_consent_type": "explicit",
"partnership_opt_ins": [],
"email_opt_in_type": {
"context": "web_form",
"kind": "radio_sure",
"context": "external",
"kind": "external",
"mailable": true,
"external_id": null,
"active": true
"external_id": "abcd12345",
"active": false
},
"member": {
"id": 111222333,
Expand Down Expand Up @@ -275,7 +291,7 @@ Permanently deletes the signature with the specified ID. Note that this will dec
"first_name": "Foo",
"join_organisation": true,
"last_name": "Bar",
"phone_number": "123-456",
"phone_number": "555-555-5555",
"postcode": "10010",
"source": "",
"token": "abcDEFghi123456789jklMNO",
Expand Down

0 comments on commit 20fda7b

Please sign in to comment.