Skip to content

Instantly share code, notes, and snippets.

@jdanyow
Last active September 21, 2019 00:17
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 jdanyow/eaa38203098bff738865fd2fa7ae8a46 to your computer and use it in GitHub Desktop.
Save jdanyow/eaa38203098bff738865fd2fa7ae8a46 to your computer and use it in GitHub Desktop.

/api/lists

Create a collection

POST https://docs.microsoft.com/api/lists

request body: name, description, type: "collection"

response body: adds "id"

patch a collection

PATCH https://docs.microsoft.com/api/lists/{id}

request body: name, description

re-order a collection

PUT https://docs.microsoft.com/api/lists/{id}/sort

request body is an array of item ids.

The logic is: anything that is not in the request body goes at the end of the list, in their current order.

response is the whole collection (same as get)

Get list of collections

GET https://docs.microsoft.com/api/lists

UI: filter on type no paging

DELETE

GET https://docs.microsoft.com/api/lists/{id}

insert an item in the collection

POST https://docs.microsoft.com/api/lists/{id}

(item will be inserted at end of list)

Request body

  • type: "docs" or "qa"
  • data.pageType + pageKind (from metadata), todo: confirm behavior for Q&A pages
  • url: front will normalize to pathname and view arg only. No locale.
  • title: snapshot, future API will provide localized title maybe, not for ignite
{
  "type": "conceptual",
  "data": {
    "docId": "350a9ca4-1407-4f80-0e3c-05609687c014",
    "docVIId": "6ae6a540-0822-5e2d-cf75-97f064fa0961",
    "pageType": "conceptual",
    "title": "Tour of .NET",
    "url": "/dotnet/standard/tour?view=foo-bar",
    "pageKind": ""
  }
}

Response body

{
  "id": "conceptual-3B01B18DD3C171863BF17D1E30D2C430",
  "listId": "bookmarks",
  "type": "conceptual",
  "data": {
    "docId": "350a9ca4-1407-4f80-0e3c-05609687c014",
    "docVIId": "6ae6a540-0822-5e2d-cf75-97f064fa0961",
    "pageType": "conceptual",
    "title": "Tour of .NET",
    "url": "https://docs.microsoft.com/en-us/dotnet/standard/tour",
    "pageKind": ""
  }
}

Add a bookmark (current)

POST https://docs.microsoft.com/api/lists/bookmarks

Request body

{
  "type": "conceptual",
  "data": {
    "docId": "350a9ca4-1407-4f80-0e3c-05609687c014",
    "docVIId": "6ae6a540-0822-5e2d-cf75-97f064fa0961",
    "pageType": "conceptual",
    "title": "Tour of .NET",
    "url": "https://docs.microsoft.com/en-us/dotnet/standard/tour",
    "pageKind": ""
  }
}

Response body

{
  "id": "conceptual-3B01B18DD3C171863BF17D1E30D2C430",
  "listId": "bookmarks",
  "type": "conceptual",
  "data": {
    "docId": "350a9ca4-1407-4f80-0e3c-05609687c014",
    "docVIId": "6ae6a540-0822-5e2d-cf75-97f064fa0961",
    "pageType": "conceptual",
    "title": "Tour of .NET",
    "url": "https://docs.microsoft.com/en-us/dotnet/standard/tour",
    "pageKind": ""
  }
}

List bookmarks (current)

GET https://docs.microsoft.com/api/lists/bookmarks

Response body

{
  "id": "bookmarks",
  "name": "Bookmarks",
  "type": "bookmarks",
  "items": [
    {
      "id": "conceptual-E42A7573B07FCC247E58E35DD411C350",
      "listId": "bookmarks",
      "type": "conceptual",
      "data": {
        "docId": "1c922021-b12a-83e4-3ee6-eceecd6076d2",
        "docVIId": "fdb655a4-cff4-6c67-7244-673760379663",
        "pageType": "conceptual",
        "title": "Get started with .NET Core",
        "url": "https://docs.microsoft.com/en-us/dotnet/core/get-started?tabs=windows",
        "pageKind": ""
      }
    },
    {
      "id": "conceptual-269DD8C72D9BA9ED9FC8491942BE8536",
      "listId": "bookmarks",
      "type": "conceptual",
      "data": {
        "docId": "663a1186-837e-65e7-fbda-a68f4f7ec8cf",
        "docVIId": "1eda8d09-c076-e1f6-414d-a714a56a8213",
        "pageType": "conceptual",
        "title": "Get Started with .NET",
        "url": "https://docs.microsoft.com/en-us/dotnet/standard/get-started",
        "pageKind": ""
      }
    },
    {
      "id": "conceptual-D679FDBAF5219D89BC51C1E9D665A040",
      "listId": "bookmarks",
      "type": "conceptual",
      "data": {
        "docId": "324ac109-634f-7e1b-6c22-694d711e7524",
        "docVIId": "349e61a9-710b-02d9-9e64-a712f8d5e2cf",
        "pageType": "conceptual",
        "title": ".NET Guide",
        "url": "https://docs.microsoft.com/en-us/dotnet/standard/",
        "pageKind": ""
      }
    },
    {
      "id": "conceptual-3B01B18DD3C171863BF17D1E30D2C430",
      "listId": "bookmarks",
      "type": "conceptual",
      "data": {
        "docId": "350a9ca4-1407-4f80-0e3c-05609687c014",
        "docVIId": "6ae6a540-0822-5e2d-cf75-97f064fa0961",
        "pageType": "conceptual",
        "title": "Tour of .NET",
        "url": "https://docs.microsoft.com/en-us/dotnet/standard/tour",
        "pageKind": ""
      }
    }
  ]
}

Remove a bookmark

DELETE https://docs.microsoft.com/api/lists/bookmarks/conceptual-3B01B18DD3C171863BF17D1E30D2C430

no request body, no response body

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