Create a new post (idea) in a specified space. The post can include file(s). To upload a file:

  1. Get the upload URL from /api/files/getuploadurl and note the fileKey value from the response.
  2. Use the fileKey from step one as the fileId in the request body.

URL Parameters

NameDescriptionLocationRequiredDefault Value
spaceIdUnique identifier of the space.pathYes
notifyBoolean value that determines whether members are notified.queryNotrue

Body Parameters

NameDescriptionJSON typeRequiredDefault Value
contentObject with task properties.
  • bodyText: (string) message text to send
  • data: (array) array of objects representing attached files
    • fileId: (string) fileKey from /files/getuploadurl
    • fileSize: (int) size of file in bytes
    • fileType: (string) 'image', 'video', 'audio', or (default) 'document'
    • name: (string) file name
    • provider: (string) 'native'
    • providerFileType: (string) MIME type
    • thumbnailFile: (string) fileKey of thumbnail from /files/getuploadurl
  • description: (string) optional description.
objectYes

Authentication

JwtAuthenticator, Oauth2Authenticator, AnonymousAuthenticator

Authorization

PERM_TOPIC_UPDATE

Example Request

URL

POST https://spacesapis.zang.io/api/spaces/{spaceId}/ideas

Headers

Authorization: "jwt eyJhbGciOiJSUzI1NiIsIdfgdfgnR5cCI6IkpXVCJ9.eyJ1c2VyX2lkX3NpZyI6ImxPWHpxNzVzR3J3X0xwWEMyRGRMakhyYXJlWVhyTzFMdEZHZkhkOWNkTXciLCJwcm9kdWN0X3R5cGUiOiJhY2NvdW50cyIsImxhc3R1cGRhdGV0aW1lIjoiMjAxNy0wMS0zMFQxMzo1ODo0Ny4yMDYiLCJpc3MiOiJ6YW5nLmlvIiwicHVibGlja2V5aWQiOiJhZ3h6Zm05dVpYTnVZVEl3TVRSeUdnc1NEVWRLZDNSUWRXSnNhV05MWlhrdfgdWdJQ2dsUEtFakFvTSIsImV4cCI6MTQ5NTM5MTIwMywidXNlcl9pZCI6ImFneHpmbTl1WlhOdVlUSXdNVFJ5RVFzU0JGVnpaWElZZ0lEQXMtX25fUW9NIiwidmVyIjoiMi4wIn0.SqZpw1uPIebqW3qlDsm0-DWYFKEH0SgPwtD-tSESWOF-5hLkZMqJH28ooWux2S7s9riIew7pTVPnZpTgJa5zHcEAG0gXSEJVOqmpGp_4ufM8YtZoZMpBFjyAkwyAt-ILkGUYIo0GU5WyzMPLV8YLXfgdfgOgkE2MGGOajBkjPmC2Db3pA0D0M9k-21EL1gwWBC5YIq0PDAkgulegwl6khRmB8irJQ-dfg-d-KV9eYfFpsCdJKRGzSfqg"

Or

Authorization: "bearer f746696f5de4528u128ae2f274eea253e8a7943a"

Body

{
"content": {
    "bodyText": "idea with a file upload",
    "description": "this is a idea with a file uploaded",
    "data": [{
        "fileId": "ec6b2632-c3ae-404d-a6b4-c04bcc49b5ea",
        "fileSize": 3239,
        "fileType": "document",
        "icon": "",
        "name": "env2 (1)",
        "provider": "native",
        "providerFileType": ""
    }]
  }
}

Example Response

{
"data": [{
    "category": "idea",
    "topicId": "58c97998d56ed915c3d28e32",
    "modified": "2017-04-28T18:12:50.787Z",
    "_id": "59038622e2cda45e3bbbfc6a",
    "content": {
        "bodyText": "idea with a file upload",
        "description": "this is idea with a file uploaded",
        "status": "pending",
        "dueDate": "2017-04-28T18:12:50.787Z",
        "data": [{
            "provider": "native",
            "providerFileType": "",
            "fileType": "document",
            "name": "env2 (1)",
            "fileId": "ec6b2632-c3ae-404d-a6b4-c04bcc49b5ea",
            "icon": "",
            "thumbnail": "",
            "keywords": "",
            "description": "",
            "previewFile": "",
            "fileSize": 3239,
            "thumbnailFile": "",
            "metaData": {
                "stgeProvd": "gcs",
                "prvwProvd": "gcs",
                "paging": 0
            },
            "pages": 0,
            "nextSchedule": null,
            "convertStart": null,
            "convertStatus": 0,
            "path": "https://storage.googleapis.com/onesnatesting/logan%2Fec6b2632-c3ae-404d-a6b4-c04bcc49b5ea?GoogleAccessId=logan-testing@onesnatesting.iam.gserviceaccount.com&Expires=1493403771&Signature=Kg%2BRu6mui065V7OSEutzK7fHcIv22dFOSWDhyRTsbM2DwtKY6%2FJuHnZXnSUoKlvfQDRTEeQ2yUrVhau%2BQA1Gt1a4aZqj0sA6FdaavQCbdx33nNQJemfYnMg5z8KS7B3SQAvrUgbk0RVetgo9nRHi0bSI%2FCALpUKzIthGsV24hf0KJCf6JykI6w873bxe7FvhSOeTkK50J%2BQ3r6J4sTE8%2B7o46lZvslQfyfJzPCQz9b9CQh3b4PRjCbWew8X81vvc8G2mv5b5nZfg%2FUQ3zeNKCh58K8assm8lcVbiXzaNaGcr71fTgvwsEyzgOAIazM5zpDa2dAeQWY4t%2B6KuWUxVfw%3D%3D&response-content-disposition=attachment%3B%20filename%3D%22env2%20(1)%22"
        }]
    },
    "created": "2017-04-28T18:12:50.787Z",
    "sender": {
        "_id": "5890b1243bab0e18ff044943",
        "type": "user",
        "username": "patrickhan@esna.com",
        "displayname": "Patrick-123 Han-han",
        "picture_url": "https://storage.googleapis.com/onesnatesting/pictures/pfpic_user_287f310f-aba5-4879-a18e-247c07c4894a"
    },
    "likeCount": 0,
    "chatCount": 0
  }]
}