Chilkat Online Tools

DataFlex / Twitter API v2 / User's pinned Lists

Back to Collection Items

Use ChilkatAx-9.5.0-win32.pkg

Procedure Test
    Handle hoHttp
    Boolean iSuccess
    Variant vSbResponseBody
    Handle hoSbResponseBody
    String sTemp1
    Integer iTemp1

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    Get Create (RefClass(cComChilkatHttp)) To hoHttp
    If (Not(IsComObjectCreated(hoHttp))) Begin
        Send CreateComObject of hoHttp
    End

    // Adds the "Authorization: Bearer <access_token>" header.
    Set ComAuthToken Of hoHttp To "<access_token>"

    Get Create (RefClass(cComChilkatStringBuilder)) To hoSbResponseBody
    If (Not(IsComObjectCreated(hoSbResponseBody))) Begin
        Send CreateComObject of hoSbResponseBody
    End
    Get pvComObject of hoSbResponseBody to vSbResponseBody
    Get ComQuickGetSb Of hoHttp "https://api.twitter.com/2/users/:id/pinned_lists" vSbResponseBody To iSuccess
    If (iSuccess = False) Begin
        Get ComLastErrorText Of hoHttp To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get ComLastStatus Of hoHttp To iTemp1
    Showln "Response status code = " iTemp1
    Get ComGetAsString Of hoSbResponseBody To sTemp1
    Showln sTemp1


End_Procedure

Curl Command

curl -X GET
	-H "Authorization: Bearer <access_token>"
https://api.twitter.com/2/users/:id/pinned_lists

Postman Collection Item JSON

{
  "name": "User's pinned Lists",
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "exec": [
          ""
        ],
        "type": "text/javascript"
      }
    }
  ],
  "protocolProfileBehavior": {
    "disableBodyPruning": true
  },
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "",
        "value": "",
        "type": "text",
        "disabled": true
      }
    ],
    "body": {
      "mode": "formdata",
      "formdata": [
      ]
    },
    "url": {
      "raw": "https://api.twitter.com/2/users/:id/pinned_lists",
      "protocol": "https",
      "host": [
        "api",
        "twitter",
        "com"
      ],
      "path": [
        "2",
        "users",
        ":id",
        "pinned_lists"
      ],
      "query": [
        {
          "key": "list.fields",
          "value": "",
          "description": "Comma-separated fields for the List object.\nAllowed values:\ncreated_at, follower_count, member_count, private, description, owner_id\nDefault values:\nid,name",
          "disabled": true
        },
        {
          "key": "expansions",
          "value": "",
          "description": "Expansions enable requests to expand an ID into a full object in the includes response object.\nAllowed value:\nowner_id\nDefault value: none",
          "disabled": true
        },
        {
          "key": "user.fields",
          "value": "",
          "description": "Comma-separated list of fields for the User object. Expansion required.\nAllowed values:\ncreated_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld\nDefault values:\nid,name,username",
          "disabled": true
        }
      ],
      "variable": [
        {
          "key": "id",
          "value": "",
          "description": "Required. The user ID whose pinned Lists you would like to retrieve. The user’s ID must correspond to the user ID of the authenticating user, meaning that you must pass the Access Tokens associated with the user ID when authenticating your request."
        }
      ]
    },
    "description": "This endpoint returns details on a user's pinned Lists specified by the requested ID\n\nFor full details, see the [API reference](https://developer.twitter.com/en/docs/twitter-api/lists/pinned-lists/api-reference/get-users-id-pinned_lists) for this endpoint.\n\n[Sign up](https://t.co/signup) for the Twitter API"
  },
  "response": [
  ]
}