2

I am trying to create an app in Podio via API on my laravel web app, however whenever I call the PodioApp::create() function it returns with PodioBadRequestError in Podio.php line 289 exception. Now i'm not sure if I will need to request for a increased trust level on my API keys from support but here is my code:

$timeclock_app = PodioApp::create(array( 'space_id' => $workspace->space_id,
                                         'type'                 => 'standard',
                                         'name'                 => 'Timeclocks',
                                         'item_name'            => 'Timeclock',
                                         'icon'                 => '270.png',  
  ));

return dd($timeclock_app);

Thanks in advance!

  • 1
    The `/app` endpoint does not require an increased trust level. It looks like you're missing quite a lot of data there (e.g. the fields you want to have in the app). Take a look at the request data here: https://developers.podio.com/doc/applications/add-new-app-22351 – domokun Jun 08 '16 at 15:15
  • Thank you for the reply domokun. Saw the request data and it seems quite alot. Are all those required? Also saw there is a 'text' (for the task), is that required too? What if I dont want to immediately have a task when I create the app? Apologies for noob questions, I'm fairly new to app creation via API. – ShieldStick Jun 08 '16 at 23:37
  • Take a look at my answer for a payload example. Also, you don't need to attach tasks right away. – domokun Jun 13 '16 at 22:09

1 Answers1

2

I believe all you're missing is data while sending your app create request.
This is an example of a complete (minimal) JSON payload needed to create an app.

All the config information are mandatory, as well as at least one field.
Everything else is optional.

{
  "config": {
    "type": "standard",
    "app_item_id_padding": 1,
    "app_item_id_prefix": "",
    "show_app_item_id": false,
    "allow_comments": true,
    "allow_create": true,
    "allow_edit": true,
    "allow_attachments": true,
    "silent_creates": false,
    "silent_edits": false,
    "disable_notifications": false,
    "default_view": "badge",
    "allow_tags": false,
    "icon": "251.png",
    "name": "App",
    "item_name": "item"
  },
  "space_id": 22788,
  "fields": [
    {
      "config": {
        "label": "Title",
        "settings": {
          "size": "small"
        },
        "required": false
      },
      "type": "text"
    }
  ]
}
domokun
  • 3,013
  • 3
  • 29
  • 55