In Slack message blocks, when adding a button, the confirmation dialog text is supposed to support markdown.
https://api.slack.com/reference/block-kit/composition-objects#text
But it just displays plain text:
{
"blocks": [
{
"type": "section",
"accessory": {
"type": "button",
"text": {
"type": "plain_text",
"text": "Validate"
},
"confirm":{
"title": {
"type": "plain_text",
"text": "Details"
},
"text": {
"type": "mrkdwn",
"text": "*bold* ?"
},
"confirm": {
"type": "plain_text",
"text": "Ok"
}
}
},
"text": {
"type": "mrkdwn",
"text": "Hello World!"
}
}
]
}
this seems to work
{
"type": "modal",
"title": {
"type": "plain_text",
"text": "My App",
"emoji": true
},
"submit": {
"type": "plain_text",
"text": "Submit",
"emoji": true
},
"close": {
"type": "plain_text",
"text": "Cancel",
"emoji": true
},
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "This is a mrkdwn section block :ghost: *this is bold*, and ~this is crossed out~, and <https://google.com|this is a link>"
}
}
]
}
I faced the same issue so I reached out to Slack's support, and they confirmed it is a known bug. They have no ETA for the fix yet.
Related
I'm creating an UGC post with mediaCategory IMAGE and multiple images attached uploaded with the recommended Assets Api.
I've noticed that LinkedIn does not respect the original order we are sending through.
Has anyone experienced this as well or has any idea what I'm missing?
{
"author": "urn:li:organization:5590506",
"lifecycleState": "PUBLISHED",
"specificContent": {
"com.linkedin.ugc.ShareContent": {
"media": [
{
"media": "urn:li:digitalmediaAsset:ID1",
"status": "READY",
"title": {
"attributes": [],
"text": "Asset 1"
}
},
{
"media": "urn:li:digitalmediaAsset:ID2",
"status": "READY",
"title": {
"attributes": [],
"text": "Asset 2"
}
},
{
"media": "urn:li:digitalmediaAsset:ID3",
"status": "READY",
"title": {
"attributes": [],
"text": "Asset 3"
}
},
{
"media": "urn:li:digitalmediaAsset:ID4",
"status": "READY",
"title": {
"attributes": [],
"text": "Asset 4"
}
},
{
"media": "urn:li:digitalmediaAsset:ID5",
"status": "READY",
"title": {
"attributes": [],
"text": "Asset 5"
}
}
],
"shareCommentary": {
"attributes": [],
"text": "Some share text"
},
"shareMediaCategory": "IMAGE"
}
},
"visibility": {
"com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC"
}
}
POST https://api.linkedin.com/v2/ugcPosts
I think you want to maintain the order of media in single post.
But I see same media ID "media": "urn:li:digitalmediaAsset:C5500AQG7r2u00ByWjw",
5 times. May be it is just a dummy message.
I think you should try get on it
GET https://api.linkedin.com/v2/ugcPosts/{encoded ugcPostUrn|shareUrn}?viewContext=AUTHOR
and you can see media order. I think media order stays same. It is just how LinkedIn is displaying it.
{
"author": "urn:li:organization:5590506",
"lifecycleState": "PUBLISHED",
"specificContent": {
"com.linkedin.ugc.ShareContent": {
"media": [
{
"media": "urn:li:digitalmediaAsset:C5500AQG7r2u00ByWjw",
"status": "READY",
"title": {
"attributes": [],
"text": "Sample Video Create"
}
}
],
"shareCommentary": {
"attributes": [],
"text": "Some share text"
},
"shareMediaCategory": "VIDEO"
}
},
"targetAudience": {
"targetedEntities": [
{
"locations": [
"urn:li:country:us",
"urn:li:country:gb"
],
"seniorities": [
"urn:li:seniority:3"
]
}
]
},
"visibility": {
"com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC"
}
}
My Stepfunction is supposed to check whether an item exist in the dynamo. if it does, it needs to generate the presigned url, otherwise it has to update the dynamodb item.
When it matches the item, it works as expected where as it fails when dynamo getitem output is null fails with states.runtime error. It does not going through catch statement. appreciate any help.
Here is my code.
{ "Comment": "A Hello World example of the Amazon States Language using Pass states", "StartAt": "Hello", "States": {
"Hello": {
"Type": "Pass",
"Next": "Verify item from DynamoDB"
},
"s3_url": {
"Type": "Pass",
"Result": "Hello",
"End": true
},
"Verify item from DynamoDB": {
"Type": "Task",
"Resource": "arn:aws:states:::dynamodb:getItem",
"Parameters": {
"TableName": "s3_table",
"Key": {
"etag": {
"S.$": "$.Records[0].s3.object.eTag"
}
}
},
"ResultPath": "$.DynamoDB",
"OutputPath": "$.DynamoDB.Item",
"Next": "s3_url",
"Catch": [
{
"ErrorEquals": [
"States.Runtime"
],
"Next": "DynamoDB Update"
}
]
},
"DynamoDB Update": {
"Type": "Task",
"Resource": "arn:aws:states:::dynamodb:putItem",
"Parameters": {
"TableName": "s3_table",
"Item": {
"etag": {
"S.$": "$.eTag"
},
"filekey": {
"S": "mp3Files"
}
}
},
"End": true
} } }
solved this using choice state. Open to hear any suggestions on Catch state.
Here is the code.
{
"Comment": "A Hello World example of the Amazon States Language using Pass states",
"StartAt": "Hello",
"States": {
"Hello": {
"Type": "Pass",
"Next": "Verify item from DynamoDB"
},
"s3_url": {
"Type": "Pass",
"Result": "Hello",
"End": true
},
"Verify item from DynamoDB": {
"Type": "Task",
"Resource": "arn:aws:states:::dynamodb:getItem",
"Parameters": {
"TableName": "s3_table",
"Key": {
"etag": {
"S.$": "$.Records[0].s3.object.eTag"
}
}
},
"ResultPath": "$.Records[0].DynamoDB",
"OutputPath": "$",
"Next": "Choice State",
"Catch": [
{
"ErrorEquals": [
"States.Runtime"
],
"Next": "DynamoDB Update"
}
]
},
"Choice State": {
"Type": "Choice",
"Choices": [
{
"Variable": "$.Records[0].DynamoDB.Item.etag.S",
"IsPresent": true,
"Next": "s3_url"
}
],
"Default": "DynamoDB Update"
},
"DynamoDB Update": {
"Type": "Task",
"Resource": "arn:aws:states:::dynamodb:putItem",
"Parameters": {
"TableName": "s3_table",
"Item": {
"etag": {
"S.$": "$.Records[0].s3.object.eTag"
},
"filekey": {
"S.$": "$.Records[0].s3.object.key"
}
}
},
"End": true
}
}
}
I have swagger api-docs.json definition generated by SpringFox.
Below minimal-reproducible-example:
{
"swagger": "2.0",
"info": {
"description": "Example REST API.",
"version": "15.11.02",
"title": "Example REST API",
"contact": {
"name": "ExampleTeam",
"url": "https://example.com/",
"email": "support#example.com"
},
"license": {
"name": "Apache License 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0.txt"
}
},
"host": "d01088db.ngrok.io",
"basePath": "/cloud",
"tags": [
{
"name": "All Endpoints",
"description": " "
}
],
"paths": {
"/api/v2/users/{userId}/jobs/{jobId}": {
"get": {
"tags": [
"Builds",
"All Endpoints"
],
"summary": "Get job.",
"operationId": "getJobUsingGET",
"produces": [
"*/*"
],
"parameters": [
{
"name": "jobId",
"in": "path",
"description": "jobId",
"required": true,
"type": "integer",
"format": "int64"
},
{
"name": "userId",
"in": "path",
"description": "userId",
"required": true,
"type": "integer",
"format": "int64"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/APIPipelineJob"
}
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
},
"404": {
"description": "Not Found"
}
},
"deprecated": false
}
}
},
"definitions": {
"APIPipelineJob": {
"type": "object",
"properties": {
"archiveTime": {
"type": "string",
"format": "date-time",
"example": "example"
},
"content": {
"type": "string",
"example": "example"
},
"createTime": {
"type": "string",
"format": "date-time",
"example": "example"
},
"id": {
"type": "integer",
"format": "int64",
"example": "example"
},
"name": {
"type": "string",
"example": "example"
},
"selfURI": {
"type": "string",
"example": "example"
},
"type": {
"type": "string",
"example": "example",
"enum": [
"BUILD",
"DEPLOY"
]
},
"userId": {
"type": "integer",
"format": "int64",
"example": "example"
}
},
"title": "APIPipelineJob",
"xml": {
"name": "APIPipelineJob",
"attribute": false,
"wrapped": false
}
}
}
}
When I import it to SwaggerHub I got standardization error:
'definitions.*' not allowed -> API must not have local definitions (i.e. only $refs are allowed)
I have found the recommended solution in SwaggerHub documentation
But here is my question how to achieve:
split into domains(then using a reference), or
inline schemas
with Springfox
Or maybe there is another way to get rid of the above standardization error?
If you go to your home page, then hover over your organization on the left hand side and go to settings > Standardization, you should see some options. Unselect "API must not have local definitions (i.e. only $refs are allowed)" at the bottom.
And don't forget to save at the top right!
Is it possible to get bold text in the title of a CardAction() in bot framework v4? I'm using it in a HeroCard. I've tried ** Option One ** but it only works in the text of a HeroCard for example, but not in the CardAction() buttons.
Here's my implementation of CardActions in a HeroCard:
var Options = new HeroCard
{
Text = "What do you choose?",
Buttons = new List<CardAction>
{
new CardAction() { Title = "Option One, Type = ActionTypes.ImBack, Value = ""Option One" },
new CardAction() { Title = "Go back", Type = ActionTypes.ImBack, Value = "Go back" },
},
};
You can't. It's up to each channel to determine how to display cards.
Alternatively, you can try using an Adaptive Card with something like the following JSON:
{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "What do you choose?"
},
{
"type": "Container",
"items": [
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "Option One",
"weight": "Bolder",
"horizontalAlignment": "Center",
"size": "Large",
"color": "Accent"
}
],
"selectAction": {
"type": "Action.Submit"
},
"id": "optionOne",
"style": "default"
},
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "Go back",
"horizontalAlignment": "Center",
"size": "Large",
"weight": "Bolder",
"color": "Accent"
}
],
"selectAction": {
"type": "Action.Submit",
"data": "goBack"
},
"id": "goBack",
"style": "default"
}
],
"style": "emphasis"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0"
}
Again, though, it will be up to the channel for how it wants to display "weight": "Bolder"
PingFederate 8.2.2 is used for our systems.All the REST APIs to create PF objects are automated but /sp/adapter(https://pfhost:9999/pf-admin-api/v1/sp/adapters) is not working using the below JSON .Manually If I create the same configuration it works.The below mentioned JSON is retrieved from already manually created /sp/adapter.But when I use the same JSON in API call which says error as below, please help to solve this problem.
ERROR:
{
"resultId": "validation_error",
"message": "Validation error(s) occurred. Please review the error(s) and address accordingly.",
"validationErrors": [
{
"message": "'' is not a valid selection for 'Send Extended Attributes'",
"fieldPath": "configuration.fields[21].value",
"errorId": "plugin_validation_error"
}
]
}
JSON:
{
"id": "opentokenadapt1",
"name": "opentokenadapt1",
"pluginDescriptorRef": {
"id": "com.pingidentity.adapters.opentoken.SpAuthnAdapter"
},
"configuration": {
"tables": [],
"fields": [
{
"name": "Password",
"value": "Password123"
},
{
"name": "Confirm Password",
"value": "Password123"
},
{
"name": "Transport Mode",
"value": "2"
},
{
"name": "Token Name",
"value": "opentoken"
},
{
"name": "Cipher Suite",
"value": "2"
},
{
"name": "Authentication Service",
"value": ""
},
{
"name": "Account Link Service",
"value": ""
},
{
"name": "Logout Service",
"value": ""
},
{
"name": "Cookie Domain",
"value": ""
},
{
"name": "Cookie Path",
"value": "/"
},
{
"name": "Token Lifetime",
"value": "300"
},
{
"name": "Session Lifetime",
"value": "43200"
},
{
"name": "Not Before Tolerance",
"value": "0"
},
{
"name": "Force SunJCE Provider",
"value": "false"
},
{
"name": "Use Verbose Error Messages",
"value": "false"
},
{
"name": "Obfuscate Password",
"value": "true"
},
{
"name": "Session Cookie",
"value": "false"
},
{
"name": "Secure Cookie",
"value": "false"
},
{
"name": "HTTP Only Flag",
"value": "true"
},
{
"name": "Send Subject as Query Parameter",
"value": ""
},
{
"name": "Subject Query Parameter ",
"value": ""
},
{
"name": "Send Extended Attributes",
"value": ""
},
{
"name": "Skip Trimming of Trailing Backslashes",
"value": "false"
}
]
},
"attributeContract": {
"coreAttributes": [
{
"name": "subject"
}
],
"extendedAttributes": [
{
"name": "nsroles"
}
]
}
}
"Send Extended Attributes" needs a valid value (not the empty string you've given it). The possible values are "0" (None), "1" (Cookies) or "2" (Query Parameters).
One tip in trying to narrow these issues down: try building the SP adapter instance in the PingFederate administrative console (UI) then compare it with the JSON model you GET from the API.