PebblePad : API documentation

Form

Provides the method to save a new form response to the Asset Store.

Methods

Method HTTP request Description
Index POST https://v3.pebblepad.co.uk/api/1.0/Form Use this endpoint to save a form response into an impersonated users Asset Store. This action is expecting a Multi-part form post.

Methods

Index

Use this endpoint to save a form response into an impersonated users Asset Store. This action is expecting a Multi-part form post.

Scope Required

formresponses:c

Request

POST https://v3.pebblepad.co.uk/api/1.0/Form

Remarks

The Answers property supports different data types, including date.
  • To specify a single date, provide the following: {\"StartDate\":\"2015-05-05T08:40:00Z\",\"EndDate\":null,\"DateType\":\"single\"}.
  • For an ongoing date: {"StartDate":"2015-05-05T08:40:00Z","EndDate":null,"DateType":"ongoing"}.
  • And for two dates: {"StartDate":"2015-05-05T08:40:00Z","EndDate":"2015-05-10T08:45:00Z","DateType":"double"}

Example request

HTTP/1.1 POST https://v3.pebblepad.co.uk/api/1.0/Form
Authorization: Bearer D/5./y_Ck01935V9u.FaY~8n157k1-y_
x-impersonateuser: pat
email=true&digest=false&dto={"formId":"597G4M9bf8383xbHj5Wb5pWgbr",
                            "title":"My title",
                            "answers":[ {"id":"826b9645-bcfe-47c9-969beccda0688985", "values":["My title"]},
                                        {"id":"826b9645-bcfe-47c9-969beccda0688986", "values":["
                                        <p><span style=\" color: #575757; font-size: 11pt;\">
                                        Grey <strong>Strong</strong> <em>Emphasised</em> text</span></p>
                                        <p><sub>Subscript</sub></p>
                                        <p><sup>Superscript</sup></p>
                                        <p><a href=\"http://www.google.co.uk\" target=\"_blank\">Weblink</a></p>
                                        "]},
                                        {"id":"826b9645-bcfe-47c9-969beccda0688987", "values":["My reflection"]}],
                            "created":"2015-02-18T16:37:34.055Z",
                            "lastModified":"2015-02-18T16:38:46.061Z",
                            "mainType":"FormResponse",
                            "subType":"Reflection"} 

Response

HTTP 200 (OK) 

Example error response

HTTP/1.1 400 (Bad Request)
{
  "errormessage":"impersonated_user_does_not_exist"
}