Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zplume/21d43d64d10b76945f9d761286be1e4b to your computer and use it in GitHub Desktop.
Save zplume/21d43d64d10b76945f9d761286be1e4b to your computer and use it in GitHub Desktop.

Using the Parse JSON action to set headers for SharePoint Online REST requests in Microsoft Flow

About

This is useful in combination with the SharePoint - Send an HTTP request to SharePoint action.

This could be expanded to include other combinations of header values, but this is what I've used so far:

Set Headers

Content

{
    "getHeaders": {
      "Accept": "application/json; odata=nometadata"
    },
    "postHeaders": {
      "Accept": "application/json; odata=nometadata",
      "Content-Type": "application/json; odata=nometadata"
    },
    "mergeHeaders": {
      "Accept": "application/json; odata=nometadata",
      "Content-Type": "application/json; odata=nometadata",
      "If-Match": "*",
      "X-HTTP-Method": "MERGE"
    }
}

Schema

{
    "type": "object",
    "properties": {
        "getHeaders": {
            "type": "object"
        },
        "postHeaders": {
            "type": "object"
        },
        "mergeHeaders": {
            "type": "object"
        }
    }
}

Example usage

Get item

Send an HTTP request to SharePoint - Get

Update item

Send an HTTP request to SharePoint - Update

Other useful REST APIs for getting/setting items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment