Microsoft Refresh Cards Issue while making and HttpPOST Action - header

I am using Microsoft's message/action cards to send it to office outlook email and take necessary action when clicking on one of the buttons. This piece works fine.
But, now I want to use refresh cards feature to update that same email/card with say a message like RESTART PERFORMED
So I do the following
"potentialAction": [{
"#type": "ActionCard",
"name": "Restart",
"inputs": [{
"#type": "TextInput",
"id": "comment",
"isMultiline": False,
"title": "Add a comment here for restart"
}],
"actions": [{
"#type": "HttpPOST",
"name": "Restart Application",
"headers": [{"CARD-UPDATE-IN-BODY": True}],
"body": json.dumps(newcard_data),
"target": "https://73zed3u4sf.execute-api.us-east-1.amazonaws.com/test/restart"
} ]
}]
But I does not refresh my card.
I also tried "headers": [{"CARD-UPDATE-IN-BODY": "true"}] but doesn't work either.
Also here
newcard_data = {
"#type": "MessageCard",
"#context": "http://schema.org/extensions",
"themeColor": "0076D7",
"summary": "STATUS MESSAGE",
"sections": [{
"activityTitle": "NEW TASK",
"activitySubtitle": "On Project EB EVENTS",
"activityImage": "someimage",
"facts": [{
"name": "STATUS",
"value": "EC2 Rebooted"
}],
"markdown": True
}],
}
Any help will be appreciated.
Thanks.

Related

Editing Schema file in BigCommerce Cornerstone Theme

Google Merchant does not recognize my product size variations. The micro data that Cornerstone theme is generating is not display the different sku and price. I tried using Schema App but they can not edit theme files.
I am struggling with where to edit the schema.json files. I believe I know what to add but can not find how to edit the files.
This is the code I believe needed:
{
"#context": "http://schema.org/",
"#type": "Product",
"name": "Clarks Falalala Shoes for Men",
"image": "https://example.net/shoes/clarks-falalala.jpeg",
"description": "A great comfortable walking shoe, carried in sizes 9-11, but now size 11 isn’t in stock",
"offers": [ {
"#type": "Offer",
"sku": "QWERTYSHOE-9",
"price": 45.99,
"priceCurrency": "EUR",
"availability": "InStock"
},{
"#type": "Offer",
"sku": "QWERTYSHOE-10",
"price": 45.99,
"priceCurrency": "EUR",
"availability": "InStock"
},{
"#type": "Offer",
"sku": "QWERTYSHOE-11",
"price": 45.99,
"priceCurrency": "EUR",
"availability": "OutOfStock"
} ]
}
Please help me with where to edit schema file.
Thank you in advance for your help.

How do i define this jsonSchema rule

I have the jsonSchema like below
[{
"path": [
"General",
"label"
],
"type": "label",
"label": "Calculate Losses From Sub-Peril(s)",
"required": true
},
{
"path": [
"General",
"fire"
],
"type": "boolean",
"default": true,
"label": "Fire"
},
{
"path": [
"General",
"fireSmoke"
],
"type": "boolean",
"default": false,
"label": "Fire and Smoke"
}
],
I have the jsonSchema Rule as below. So if the user unchecks both fire and Fire and Smoke i want to fire a notification. How do i define JsonSchema Rule. Can some one fix this? I have the below rule but it gives me parser error. Atleast one checkbox has to be selected.
{
"path": [
"General",
"fire"
],
"effect": "fireNotification",
"notification": {
"type": "warning",
"message": "At least one Sub-Peril must be selected",
"notificationID": "fire",
"dismissible": "false"
},
"condition": {
"operator": "oneOf": {
"properties": {
"fire": {
"enum": [
true
]
},
"fireSmoke": {
"enum": [
true
]
}
}
}
}
}
Your JSON is invalid in two ways, both on the same line:
"operator": "oneOf": {
After "operator":, you need another opening brace ({) (and a matching closing brace later on.
The value of "oneOf": should be an array, so you need to add an opening bracket ([) there (and a matching closing bracket later on).
Further, you say "At least one checkbox has to be selected", but you are using a "oneOf" rule, not "anyOf". With "oneOf", if both properties are true, the validation will fail.

"Select" block attribute invalid

I've been enjoying learning Liquid using YouTube videos by Shopify developers and staff, but I've run into a rather bizarre hitch. It is my understanding that Block types are arbitrary text strings that I determine. The YouTube video I'm following using the type "select" to create multiple blocks with a callout in the presets section. However, the debugger rejects this term as an "invalid ID."
My schema is below:
{% schema %}
{
"name": "Footer Section",
"max_blocks": 3,
"settings": [
{
"id": "footer-section-title",
"type": "text",
"label": "Footer Title",
"default": "Footer"
}
],
"blocks": [
{
"type": "select",
"name": "select",
"settings:": [
{
"id": "footer-linktext",
"type": "text",
"label": "Link Text",
"default": "Click Here"
},
{
"id": "footer-linkurl",
"type": "url",
"label": "Link URL",
"default": "Click Here"
}
]
}
],
"presets": [
{
"name": "Footer Blocks",
"category": "Footer",
"blocks": [
{
"type": "select"
},
{
"type": "select"
}
]
}
]
}
{% endschema %}
This is nearly identical to the one that appears to work in the video in 2017. Have things changed? I've tried other terms, but all are rejected.
Thank you in advance!
Your "settings:": [ have additional : in the string. That's what is throwing errors.
Change it to only "settings" and you shouldn't have problems.

HTTP Post with ContentURL

I a using Microsoft Bot Framework and am trying to do a HTTP Post with an image sent to the bot as an attachment. I see a ContentURL in the Attachment object but cannot figure out how to POST the image to my API with RestSharp?
Any Ideas?
There are a couple possibilities here.
First is to send an image as an attachment. Please see this documentation you JSON would look like this:
{
"type": "message",
"from": {
"id": "12345678",
"name": "sender's name"
},
"conversation": {
"id": "abcd1234",
"name": "conversation's name"
},
"recipient": {
"id": "1234abcd",
"name": "recipient's name"
},
"text": "Here's a picture of the duck I was telling you about.",
"attachments": [
{
"contentType": "image/png",
"contentUrl": "http://aka.ms/Fo983c",
"name": "duck-on-a-rock.jpg"
}
],
"replyToId": "5d5cdc723
}
the other possibility is that you could send an image in a card (which has 2 possibilities itself). For this you can see this documentation for rich cards. in this here is an example of the JSON for that
{
"type": "message",
"from": {
"id": "12345678",
"name": "sender's name"
},
"conversation": {
"id": "abcd1234",
"name": "conversation's name"
},
"recipient": {
"id": "1234abcd",
"name": "recipient's name"
},
"attachments": [
{
"contentType": "application/vnd.microsoft.card.hero",
"content": {
"title": "title goes here",
"subtitle": "subtitle goes here",
"text": "descriptive text goes here",
"images": [
{
"url": "http://aka.ms/Fo983c",
"alt": "picture of a duck",
"tap": {
"type": "playAudio",
"value": "url to an audio track of a duck call goes here"
}
}
],
"buttons": [
{
"type": "playAudio",
"title": "Duck Call",
"value": "url to an audio track of a duck call goes here"
},
{
"type": "openUrl",
"title": "Watch Video",
"image": "http://aka.ms/Fo983c",
"value": "url goes here of the duck in flight"
}
]
}
}
],
"replyToId": "5d5cdc723"
}
the second option for cards would be adaptive cards. by using the visualizer you can actually manipulate the JSON and see how it would be rendered in different channels.

Get list of users with the "send on behalf of" permission

Using the V2 DocuSign REST API, is it possible to get a list of users who have the "send on behalf of" and "account wide" permission?
Looking through the docs, I see that the Get User List method does not return any permission info. The Get User Information method returns a little more but nothing permission specific, other than a permissionProfileId for each group.
So is it possible to get permission info with user data? Or is there a method I can call using the permissionProfileId to check if a user has those permissions?
What I am ultimately trying to do is get a list of users who are able to use the "Send on behalf of" feature which requires the "send on behalf of" and "account-wide rights" permissions.
You can get a list of all users and their User Settings with below rest method as an DS Admin:
https://demo.docusign.net/restapi/v2/accounts/[accountid]/users/?additional_info=true
Sample output below:
{
"users": [
{
"userName": "DocuSignTest2 User-2",
"userId": "b67aa83b-2b3e-4669-a897-89e44b5724c2",
"userType": "CompanyUser",
"isAdmin": "False",
"userStatus": "Created",
"uri": "/users/b67aa83b-2b3e-4669-a897-89e44b5724c2",
"email": "youremail#yourdoman.com",
"firstName": "DocuSignTest2",
"lastName": "User-2",
"userSettings": [
{
"name": "canManageAccount",
"value": "false"
},
{
"name": "canSendEnvelope",
"value": "true"
},
{
"name": "locale",
"value": "en"
},
{
"name": "canSendAPIRequests",
"value": "false"
},
{
"name": "apiAccountWideAccess",
"value": "false"
},
{
"name": "enableVaulting",
"value": "false"
},
{
"name": "vaultingMode",
"value": "none"
},
{
"name": "enableTransactionPoint",
"value": "true"
},
{
"name": "enableSequentialSigningAPI",
"value": "true"
},
{
"name": "enableSquentialSigningUI",
"value": "true"
},
{
"name": "enableDSPro",
"value": "false"
},
{
"name": "powerFormAdmin",
"value": "false"
},
{
"name": "powerFormUser",
"value": "true"
},
{
"name": "canEditSharedAddressbook",
"value": "use_private_and_shared"
},
{
"name": "canManageTemplates",
"value": "create"
},
{
"name": "enableSignOnPaperOverride",
"value": "false"
},
{
"name": "enableSignerAttachments",
"value": "true"
},
{
"name": "allowSendOnBehalfOf",
"value": "false"
},
{
"name": "allowRecipientLanguageSelection",
"value": "true"
},
{
"name": "selfSignedRecipientEmailDocument",
"value": "include_pdf"
}
],
"sendActivationOnInvalidLogin": "false",
"enableConnectForUser": "false",
"groupList": [
{
"groupId": "128693",
"groupName": "Everyone",
"groupType": "everyoneGroup"
}
],
"workAddress": {
"address1": "",
"address2": "",
"city": "",
"stateOrProvince": "",
"postalCode": "",
"phone": "",
"country": ""
},
"homeAddress": {
"address1": "",
"address2": "",
"city": "",
"stateOrProvince": "",
"postalCode": "",
"phone": "",
"country": ""
}
},
[rest removed for sake of example]
There is not one call that can complete this task.
My recommendation is to put all of these users in a Group and then you can query who is in the group through the API.
Example get list of user's per group:
GET https://{server}.docusign.net/restapi/v2/accounts/{accountId}/groups/{groupId}/users
If you want to audit the group or see who you need to move into the group you can get a list of users and then look at user details per user (loop through programmaticaly).
Example get user settings to check userSettings->allowSendOnBehalfOf :
GET https://{server}.docusign.net/restapi/v2/accounts/{accountId}/users/{userId}