Tuesday, February 27, 2024

400, 403, 405, 415 or XSRF check failed when sending POST to custom rest endpoint + Power automate Desktop

I need to get list of projects issues from Jira using custom rest endpoint in power automate desktop (that it (API) works fine when I call it from postman), but when I submit this dialog, it appears "XSRF check failed".



I am using the basic AUTH to get issue using the API in postman and it created successfully but when I do the same using the invoke webservice action - it gives me 403 XSRF check failed
https://domain/rest/api/latest/search

  • Adding headers: { 'X-Atlassian-Token': 'nocheck' }

  • JQL query as per the requirement in request body - Screenshot captured below

  • Click advanced setting.

    Uncheck this option if it is checked - Screenshot captured below

  • Change User Agents Header - Power Automate Desktop Screenshot captured below 
  • Whitelist/Allowlist the origin domain in Jira. When you send a request to the Jira API your browser automatically populates the "origin" header. You need to add that value to the whitelist/allowlist in Jira. -> See here: https://confluence.atlassian.com/adminjiraserver073/configuring-the-allowlist-1014667631.html Type "Domain" should work.

Resolution

To call protected APIs from external systems you can add the X-Atlassian-Token header to each request, setting the value to no-check. Adding this header to a request bypasses the server-side XSRF check and allows the request to be fulfilled and set the User Agent : "PostmanRuntime/7.30.0"

Regarding getting issues from JIRA using the action "Invoke Web Service". You can solve the issue "XSRF Check Failed" by adding following headers:

X-Atlassian-Token: nocheck
Authorization: Basic <base64>
User-Agent: PowerAutomateDesktop/1.0.0 OR User-Agent: PostmanRuntime/7.30.0



Hope this helps!

Friday, February 23, 2024

How to Send bulk Messages on WhatsApp Without Adding or saving Contact

WhatsApp provides a great communication platform for businesses and organizations. However, while it offers many features like Broadcast Lists and WhatsApp communities that make business communication easier, it doesn’t directly support sending bulk messages to numbers that aren’t saved as contacts in your phone. If you’re generating leads online and contacting them through WhatsApp, you wouldn’t save each contact on your phone, which is not only tedious but may also make your contacts list messy. So what do you do in that case?  

Method 1: Send Bulk Message Using Third Party Tools

Method 2: Using WhatsApp’s ‘Click to Chat’ Feature

WhatsApp has a ‘Click to Chat’ feature that allows users to send messages to unsaved numbers. This feature uses a URL format (https://wa.me/<number>) to open a chat window. You can then send your message to the number without saving it on your contacts. Here’s a step-by-step process to use ‘Click to Chat’ feature:

1.    Type https://wa.me/ and add the number you wish to send messages to (enter country code and the mobile number). For example, if you wish to send a message to a U.S. number (country code +91), and the mobile number is 1234567890, the URL becomes https://wa.me/911234567890

2.    Paste the URL into your web browser and hit enter.

3.    A page will appear with a ‘Continue to Chat’ option. Click it to open the chat in WhatsApp.

4.    You can now send a message without adding the number as a contact.

While this method doesn’t allow you to send bulk messages in one go by default, it’s a handy workaround for sending individual messages to multiple unsaved contacts. You can combine this method with your spreadsheet to use a formula to auto-generate the links for many people at a time. 

Put in csv and use Power automate tool to this.

Method 3: Using WhatsApp Business API

Thursday, January 25, 2024

Create or Set up a Microsoft 365 developer sandbox subscription

 https://learn.microsoft.com/en-us/office/developer-program/microsoft-365-developer-program-get-started


https://devblogs.microsoft.com/microsoft365dev/microsoft-365-developer-program-instant-sandbox-update/


https://devblogs.microsoft.com/powerplatform/



Can't pass the security check-in sending SMS code

In the M365 Developer Program, when I try to activate my sandbox and go into the Add phone number for security, I enter my mobile number but it shows this error: We can't continue with the signup process for the following reasons: Your phone number did not pass security checks. Your phone cannot receive an SMS code. MS-CorrelationID:

We can't continue with the signup process for the following reason:

  • Your phone number did not pass security checks.

MS-CorrelationId: 00000000-2832-451e-947e-3a67daf3e589

Code: 40301

To quickly help assist, kindly contact our dedicated technical team via phone support Find Microsoft 365 for business support phone numbers by country or region - Microsoft 365 admin | Microsoft Learn they will check and assist you accurately

https://learn.microsoft.com/en-us/microsoft-365/admin/support-contact-info?view=o365-worldwide

India
Phone number:  000 800 440 2038
Local toll-free

Billing support hours:
English: Monday through Friday, 9 AM-6 PM



Wednesday, September 23, 2020

Azure Function Chaining - Get web Title in SharePoint Online

Visual Studio sample code

Here is the orchestration as a single C# file in a Visual Studio project:
using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.Azure.WebJobs; namespace VSSample { public static class HelloSequence { [FunctionName("E1_HelloSequence")] public static async Task<List<string>> Run( [OrchestrationTrigger] DurableOrchestrationContextBase context) { var outputs = new List<string>();
var SiteUrl="https://tenant.sharepoint.com/sites/TestSite";
outputs.Add(await context.CallActivityAsync<string>("E1_GetSiteTitle", SiteUrl)); return outputs; } [FunctionName("E1_GetSiteTitle")] public static string GetSiteTitle([ActivityTrigger] DurableActivityContextBase context)
        {
            string siteDescription = "this is communication site for test purpose";
            string siteUrl = "https://gidcmylan.sharepoint.com/sites/" + webTitle;
            string tenantURL = "https://gidcmylan-admin.sharepoint.com";
            string UName = "test@gidcmylan.onmicrosoft.com";
            string Password = "Mylan@123";
            string communityUrl = string.Empty;

            SecureString securePwd = new SecureString();
            foreach (char c in Password)
            {
                securePwd.AppendChar(c);
            }
            securePwd.MakeReadOnly();
            /* Create Site using CreateSiteAsync method */
            using (var ctx = new ClientContext(siteUrl))
            {
                // ctx.Credentials = new NetworkCredentials(userName, pwd);
                ctx.Credentials = new SharePointOnlineCredentials(UName, securePwd);
                ctx.RequestTimeout = Timeout.Infinite;

                // Just to output the site details
                Web web = ctx.Web;
                ctx.Load(web, w => w.Title);
                ctx.ExecuteQuery();
                communityUrl = "Web Title is :" + web.Title;
            }

            return $"Hello {communityUrl}!";
        }
} }

Console Application to Create new Subsite under site collection using CSOM + SharePoint Online

 using System;

using System.Security;

using Microsoft.SharePoint.Client;


namespace ConsoleAppCreateSubsite

{

    class Program

    {

        static void Main(string[] args)

        {

            Console.WriteLine("Enter Your Username Please  ------- ");

            string userName = Console.ReadLine();

            //string userName = "girish.kumar@happiestbarik.onmicrosoft.com";

            Console.WriteLine("Enter Your Password Please  ------- ");

            SecureString password = GetPasswordOfYourSite();

            Console.WriteLine("Enter Your Site collection URL  ------- ");

            string SiteCollURL = Console.ReadLine();

            Console.WriteLine("Enter Your New Subsite URL name   ------- ");

            string newSubsiteName = Console.ReadLine();

            ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation();

            using (var clientContext = new

            ClientContext(SiteCollURL))

            {

                // SharePoint Online Credentials  

                clientContext.Credentials = new SharePointOnlineCredentials(userName, password);

                // Get the SharePoint web  

                WebCreationInformation creation = new WebCreationInformation();

                creation.Url = newSubsiteName; //"MyConsoleWeb";

                creation.Title = "WelcomeToConsoleWeb";

                Web newWeb = clientContext.Web.Webs.Add(creation);


                // Retrieve the new web information. 

                clientContext.Load(newWeb, w => w.Title);

                clientContext.ExecuteQuery();

                clientContext.ExecuteQuery();

            }


        }


        private static SecureString GetPasswordOfYourSite()

        {

            ConsoleKeyInfo info;

            //Get the user's password as a SecureString  

            SecureString securePassword = new SecureString();

            do

            {

                info = Console.ReadKey(true);

                if (info.Key != ConsoleKey.Enter)

                {

                    securePassword.AppendChar(info.KeyChar);

                }

            }

            while (info.Key != ConsoleKey.Enter);

            return securePassword;

        }

    }

}

Thursday, February 13, 2020

Powershell Script for add “everyone, except external users” to the visitors group

Dear Reader,

PS script to  add “everyone, except external users” to the visitors' group.

And finding the display name and login Name for users.

Just Replace Tenant name, organizations name, admin credentials

PS C:\WINDOWS\system32> $adminUPN="girishkumar@{Tenant}.onmicrosoft.com"

PS C:\WINDOWS\system32> $orgName="{Tenant name}"

PS C:\WINDOWS\system32> $userCredential = Get-Credential -UserName $adminUPN -Message "Type the password."

PS C:\WINDOWS\system32> Connect-SPOService -Url https://$orgName-admin.sharepoint.com -Credential $userCredential

Get-SPOUser -Site https://$orgName.sharepoint.com/sites/SiteName | Select DisplayName, LoginName

PS C:\WINDOWS\system32> Add-SPOUser -Site https://$orgName.sharepoint.com/sites/Coronavirus -LoginName "c:0-.f|rolemanager|spo-grid-all-users/{GUID}" -Group "Site Visitors"

Display Name                   Login Name                                              Groups                 User Type
------------                   ----------                                              ------                 ---------
Everyone except external users spo-grid-all-users/{GUID} {Site Visitors} Member


All the Best! Thanks for reading my blog, please do comment and share if you feel helpful.


Kind Regards,

Girish Kumar M S

Tuesday, September 17, 2019

List of HTTP status codes

List of HTTP status codes

All HTTP response status codes are separated into five classes (or categories). The first digit of the status code defines the class of response. The last two digits do not have any class or categorization role. There are five values for the first digit:
  • 1xx (Informational): The request was received, continuing process
  • 2xx (Successful): The request was successfully received, understood and accepted
  • 3xx (Redirection): Further action needs to be taken in order to complete the request
  • 4xx (Client Error): The request contains bad syntax or cannot be fulfilled
  • 5xx (Server Error): The server failed to fulfill an apparently valid request



HTTP response status codes indicate whether a specific HTTP request has been successfully completed. Responses are grouped in five classes:
  1. Informational responses (100199),
  2. Successful responses (200299),
  3. Redirects (300399),
  4. Client errors (400499),
  5. and Server errors (500599).





Reference Links:

https://en.wikipedia.org/wiki/List_of_HTTP_status_codes


https://developer.mozilla.org/en-US/docs/Web/HTTP/Status

https://www.restapitutorial.com/httpstatuscodes.html

How to Deploy Your HTML Website on a Linux Server (Apache + SFTP)

Launching a simple HTML website on your own Linux server is easier than you might think. Whether you're sharing a static landing page or...