How to export space with comments in Confluence REST API? - confluence

I am using this REST URL to export a whole space:
/rest/api/content?spaceKey=TD&limit=50&expand=title,version,body.storage.value,body.view.value&os_authType=basic
However I can't find a way to include page comments in the response.
EDIT: I have found out how to get the comment but cannot get the comment body:
/rest/api/content?spaceKey=TD&limit=50&expand=title,version,body.storage.value,body.storage.content.children.comment,container,metadata.labels&os_authType=basic
The problem now comes with trying to expand the comment body. This URL:
/rest/api/content?spaceKey=TD&limit=50&expand=title,version,body.storage.value,body.view.value,body.storage.content.children.comment.body,body.storage.content.children.comment.version,container,metadata.labels&os_authType=basic
Gives this error:
{
statusCode: 500,
message: "java.lang.IllegalArgumentException: Cannot recursively expand : body"
}

After extensive research I have concluded this is impossible.

Related

Bot press chatbot is working fine is botpres editor, but failing in external website

I made a bot which is perfectly working in Botpress editor. But facing difficulty when added to external UI. I followed the instructions # https://botpress.io/docs/channels/web/ . But I am getting the below error
"13:06:59.118 DialogEngine Error processing “say
!builtin_text-lbs0Re” Err: Content element “!builtin_text-lbs0Re” not found "
However my content Json file contains the message
{ “id”: “builtin_text-lbs0Re”, “formData”: { “text$en”: “Hey, This is
Nexa. I would like to help you understand N8 Basic questions”,
“typing$en”: true, “variations$en”: [] },
My html page looks as below - SImilar to Botpress documentation
` window.botpressWebChat.init({ host: http://localhost:3000/', botId: 'your _bot _id_here' })
The error i am getting is
bp:dialog (bot) [z3AS4gXX8UuhjJ6sHfXEH] render element
“#!builtin_text-lbs0Re” +20s 13:06:59.118 DialogEngine Error
processing “say #!builtin_text-lbs0Re” Err: Content element
“!builtin_text-lbs0Re” not found Flow: main.flow.json Node: entry
[Error, Content element “!builtin_text-lbs0Re” not found] STACK TRACE
Error: Content element “!builtin_text-lbs0Re” not found at
DialogEngine._reportProcessingError
(/snapshot/build-mac/out/bp/core/services/dialog/dialog-engine.js:0:0)
at DialogEngine.
(/snapshot/build-mac/out/bp/core/services/dialog/dialog-engine.js:0:0)
at Generator.throw () at rejected
(/snapshot/build-mac/out/bp/core/services/dialog/dialog-engine.js:0:0)
at tryCatcher
(/Users/Downloads/botpress-v11_9_next-2019-05-21-darwin-x64/modules/.cache/module__0d92e45acb6587a48fca5bf12039dcea04d4f1f731482cc6548205bb16ee42d1/node_production_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler
(/Users/Downloads/botpress-v11_9_next-2019-05-21-darwin-x64/modules/.cache/module__0d92e45acb6587a48fca5bf12039dcea04d4f1f731482cc6548205bb16ee42d1/node_production_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise
(/Users/Downloads/botpress-v11_9_next-2019-05-21-darwin
Could someone please help me to point out the error?
Did you put your bot id?
window.botpressWebChat.init({ host: http://localhost:3000/', botId: 'MyBot' })

Unable to retrieve 'ContentId' property of Attachment in Office365 REST Api

I'm trying to retrieve attachments in the Office365 rest api. Since I want to avoid downloading the entire attachments, I'm using a select clause to avoid downloading the content, which is in the ContentBytes property:
$select="ContentId,ContentType,Id,IsInline,Name,Size"
So basically, I want to retrieve everything except the content. However, this gives the following error message (json):
{
"error":
{
"code": "RequestBroker-ParseUri",
"message": "Could not find a property named 'ContentId' on type 'Microsoft.OutlookServices.Attachment'."
}
}
It's telling me that ContentId doesn't exist, which contradicts the specifications.
Edit: Here is the full request:
GET /api/v2.0/me/messages/AAMkAGZlZjI3N2I3LTg1YWUtNDFiNC05MGI0LTVjYTVmZGI5NGI2YQBGAAAAAABzr8uDji9LRqgTCEsDv22wBwBWTXbvZW0dTKuxUGxpK4-lAAAAAAEMAABWTXbvZW0dTKuxUGxpK4-lAAC5QnKBAAA=/attachments?%24select=ContentId%2CContentType%2CId%2CIsInline%2CName%2CSize
Even more strange, when I do the same query without specifying any select clause, it returns me a full attachment object, including a ContentId.
Anybody can help?
In case anyone has the same question for microsoft graph, you need to pass this filter:
$select=microsoft.graph.fileAttachment/contentId
like this:
GET https://graph.microsoft.com/v1.0/me/messages/attachments?$select=microsoft.graph.fileAttachment/contentId
The request that you posted is getting the message specifications but not the attachments. Since you need to get the content id, you need to add /attachments to the request with any required parameters.
GET https://outlook.office.com/api/v2.0/me/messages/{message_id}/attachments/{attachment_id}
So please add the attachments to your query to be able to get the content id.
Hope this helps.
Solved it. The answer was suggested by Brian's comment and I found an additional hint here.
Since 'ContentId' is a property of a FileAttachment, you need to specify that in the request, like so:
$select="Microsoft.OutlookServices.FileAttachment/ContentId,ContentType,Id,IsInline,Name,Size"
That did the trick. Thanks for the suggestions.

Marketo "Import Lead" fails with error 610 Requested resource not found

I'm trying to batch update a bunch of existing records through Marketo's REST API. According to the documentation, the Import Lead function seems to be ideal for this.
In short, I'm getting the error "610 Resource Not Found" upon using the curl sample from the documentation. Here are some steps I've taken.
Fetching the auth_token is not a problem:
$ curl "https://<identity_path>/identity/oauth/token?
grant_type=client_credentials&client_id=<my_client_id>
&client_secret=<my_client_secret>"
Proving the token is valid, fetching a single lead isn't a problem as well:
# Fetch the record - outputs just fine
$ curl "https://<rest_path>/rest/v1/lead/1.json?access_token=<access_token>"
# output:
{
"requestId": "ab9d#12345abc45",
"result": [
{
"id": 1,
"updatedAt": "2014-09-18T13:00:00+0000",
"lastName": "Potter",
"email": "harry#hogwartz.co.uk",
"createdAt": "2014-09-18T12:00:00+0000",
"firstName": "Harry"
}
],
"success": true
}
Now here's the pain, when I try to upload a CSV file using the Import Lead function. Like so:
# "Import Lead" function
$ curl -i -F format=csv -F file=#test.csv -F access_token=<access_token>
"https://<rest_path>/rest/bulk/v1/leads.json"
# results in the following error
{
"requestId": "f2b6#14888a7385a",
"success": false,
"errors": [
{
"code": "610",
"message": "Requested resource not found"
}
]
}
The error codes documentation only states Requested resource not found, nothing else. So my question is: what is causing the 610 error code - and how can I fix it?
Further steps I've tried, with no success:
Placing the access_token as url parameter (e.g. appending '?access_token=xxx' to the url), with no effect.
Stripping down the CSV (yes, it's comma seperated) to a bare minimum (e.g. only fields 'id' and 'lastName')
Looked at the question Marketo API and Python, Post request failing
Verified that the CSV doesn't have some funky line endings
I have no idea if there are specific requirements for the CSV file, like column orders, though...
Any tips or suggestions?
Error code 610 can represent something akin to a '404' for urls under the REST endpoint, i.e. your rest_path. I'm guessing this is why you are getting that '404': Marketo's docs show REST paths as starting with '/rest', yet their rest endpoint ends with /rest, so if you follow their directions you get an url like, xxxx.mktorest.com/rest/rest/v1/lead/..., i.e. with '/rest' twice. This is not correct. Your url must have only one 'rest/'.
I went through the same trouble, just want to share some points that help resolve my problem.
Bulk API endpoints are not prefixed with ‘/rest’ like other endpoints.
Bulk Import uses the same permissions model as the Marketo REST API and does not require any additional special permissions in order to use, though specific permissions are required for each set of endpoints.
As #Ethan Herdrick suggested, the endpoints in the documentation are sometimes prefixed with an extra /rest, make sure to remove that.
If you're a beginner and need step-by-step instructions to set up permissions for Marketo REST API: Quick Start Guide for Marketo REST API

I'd like to know how to change pages in Form Post

I'd like to know how to change pages by putting some in Forms by Post way.
http://www.aldoshoes.com/us/women/shoes/flats
in this page
How do I move to page 2 by putting some variabels in URL?
Please help me out.
This is not possible because it seems to me that the server does not handle GET parameters in the http request.
However it is possible to achieve this using POST parameters, either programmatically or using a plug-in for Chrome/Firefox (see Super User question).
The server accepts the following parameters:
formAction:
startRow:1
rowsperPage:12
flagID:
seasonID:
dimensionID:
sizeID:
colorID:
colorGroupID:
itemCategoryLevel1:1100
itemCategoryLevel2:1101
itemCategoryLevel3:1120
itemCategoryLevel4:
styleID:
styleDescription:
keywords:
alternateDescription:
descriptionDetail1:
descriptionDetail2:
descriptionDetail3:
onsale:N
sortBy:
itemFamilyID:
heelHeight:
To get to the second page of the shop you can set the parameter startRow to 13:
startRow:13
rowsperPage:12

How to get a single gist from github with GET /gists/:id

Somehow I fail to get a single gist from github.
Lets say i would like to get the following gist: https://gist.github.com/jrm2k6/6637633
Just copy&paste in URL field of your browser.
With https://api.github.com/users/jrm2k6 I can get the users info as json.
With https://api.github.com/users/jrm2k6/gists I can list all the public gists from this user as json.
But how do I get a specific gist GET /gists/:id with the id = 6637633 like it is described here in the api documentation: http://developer.github.com/v3/gists/#get-a-single-gist
With https://api.github.com/users/jrm2k6/gists/6637633 I should receive the content of the gist as json but instead I receive an error
{
"message": "Not Found",
"documentation_url": "http://developer.github.com/v3"
}
What am I doing wrong?
SOLUTION: You do not need the /users/:user. Working: https://api.github.com/gists/6637633
The documentation for all gists mentions
GET /users/:user/gists
Notice that the documentation for a single gist mentions
GET /gists/:id
so you do not need a user. https://api.github.com/gists/6637633 will work.