Chilkat Online Tools

PowerBuilder / Twitter API v2 / Add Rules

Back to Collection Items

integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_Json
oleobject loo_Resp
oleobject loo_SbResponseBody
oleobject loo_JResp
integer li_RespStatusCode
string ls_Value
string ls_Title
string ls_V_type
integer j
integer li_Count_j
string ls_StrVal
string ls_Sent
integer li_Created
integer li_Not_created
integer li_Valid
integer li_Invalid
integer i
integer li_Count_i

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

loo_Http = create oleobject
li_rc = loo_Http.ConnectToNewObject("Chilkat_9_5_0.Http")
if li_rc < 0 then
    destroy loo_Http
    MessageBox("Error","Connecting to COM object failed")
    return
end if

// Use this online tool to generate code from sample JSON: Generate Code to Create JSON

// The following JSON is sent in the request body.

// {
//   "add": [
//     {
//       "value": "bio_location:nyc",
//       "tag": "testtopic"
//     }
//   ]
// }

loo_Json = create oleobject
li_rc = loo_Json.ConnectToNewObject("Chilkat_9_5_0.JsonObject")

loo_Json.UpdateString("add[0].value","bio_location:nyc")
loo_Json.UpdateString("add[0].tag","testtopic")

// Adds the "Authorization: Bearer <access_token>" header.
loo_Http.AuthToken = "<access_token>"

loo_Resp = loo_Http.PostJson3("https://api.twitter.com/2/tweets/search/stream/rules","application/json",loo_Json)
if loo_Http.LastMethodSuccess = 0 then
    Write-Debug loo_Http.LastErrorText
    destroy loo_Http
    destroy loo_Json
    return
end if

loo_SbResponseBody = create oleobject
li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat_9_5_0.StringBuilder")

loo_Resp.GetBodySb(loo_SbResponseBody)

loo_JResp = create oleobject
li_rc = loo_JResp.ConnectToNewObject("Chilkat_9_5_0.JsonObject")

loo_JResp.LoadSb(loo_SbResponseBody)
loo_JResp.EmitCompact = 0

Write-Debug "Response Body:"
Write-Debug loo_JResp.Emit()

li_RespStatusCode = loo_Resp.StatusCode
Write-Debug "Response Status Code = " + string(li_RespStatusCode)
if li_RespStatusCode >= 400 then
    Write-Debug "Response Header:"
    Write-Debug loo_Resp.Header
    Write-Debug "Failed."
    destroy loo_Resp
    destroy loo_Http
    destroy loo_Json
    destroy loo_SbResponseBody
    destroy loo_JResp
    return
end if

destroy loo_Resp

// Sample JSON response:
// (Sample code for parsing the JSON response is shown below)

// {
//   "meta": {
//     "sent": "2020-06-18T15:56:35.056Z",
//     "summary": {
//       "created": 0,
//       "not_created": 1,
//       "valid": 0,
//       "invalid": 1
//     }
//   },
//   "errors": [
//     {
//       "value": "plantains or tostones or guacamole or arepas or tacos or mushrooms or porcini or hen of the woods or cremini or enoki or shiitake or carbonara or cacio e pepe or amatriciana or parmigiano reggiano or california burrito or chipotle or carne asada fries or laksa or hokkien mee or chili crab or nasi lemak or hainan chicken rice or kaya toast or bak kut teh or popiah or pisang goreng or curry puff or nasi uduk or martabak or fried chicken or bbq or kimchi or yukgaejang or galbitang or xiao long bao or pizza or ice cream sandwich",
//       "details": [
//         "Too many positive clauses in rule - 100.  The maximum allowed is 30 (at position 1)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 36)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 484)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 131)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 160)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 447)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 253)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 220)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 55)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 119)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 342)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 501)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 305)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 144)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 175)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 367)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 398)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 328)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 423)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 198)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 262)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 357)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 68)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 99)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 291)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 384)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 510)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 411)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 440)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 23)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 471)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 277)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 79)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 46)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 110)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 11)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 457)",
//         "Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \"or\" to find occurrences of or in text (at position 232)",
//         "Rule 'plantains or tostones or guacamole or arepas or tacos or mushrooms or porcini or hen of the woods or cremini or enoki or shiitake or carbonara or cacio e pepe or amatriciana or parmigiano reggiano or california burrito or chipotle or carne asada fries or laksa or hokkien mee or chili crab or nasi lemak or hainan chicken rice or kaya toast or bak kut teh or popiah or pisang goreng or curry puff or nasi uduk or martabak or fried chicken or bbq or kimchi or yukgaejang or galbitang or xiao long bao or pizza or ice cream sandwich' exceeds the maximum length of a rule. It is 530 characters while the maximum allowed is 512 (at position 1)"
//       ],
//       "title": "UnprocessableEntity",
//       "type": "https://api.twitter.com/2/problems/invalid-rules"
//     }
//   ]
// }

// Sample code for parsing the JSON response...
// Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code

ls_Sent = loo_JResp.StringOf("meta.sent")
li_Created = loo_JResp.IntOf("meta.summary.created")
li_Not_created = loo_JResp.IntOf("meta.summary.not_created")
li_Valid = loo_JResp.IntOf("meta.summary.valid")
li_Invalid = loo_JResp.IntOf("meta.summary.invalid")
i = 0
li_Count_i = loo_JResp.SizeOfArray("errors")
do while i < li_Count_i
    loo_JResp.I = i
    ls_Value = loo_JResp.StringOf("errors[i].value")
    ls_Title = loo_JResp.StringOf("errors[i].title")
    ls_V_type = loo_JResp.StringOf("errors[i].type")
    j = 0
    li_Count_j = loo_JResp.SizeOfArray("errors[i].details")
    do while j < li_Count_j
        loo_JResp.J = j
        ls_StrVal = loo_JResp.StringOf("errors[i].details[j]")
        j = j + 1
    loop
    i = i + 1
loop


destroy loo_Http
destroy loo_Json
destroy loo_SbResponseBody
destroy loo_JResp

Curl Command

curl -X POST
	-H "Authorization: Bearer <access_token>"
	-d '{
    "add": [
        {
            "value": "bio_location:nyc",
            "tag": "testtopic"
        }
    ]
}'
https://api.twitter.com/2/tweets/search/stream/rules

Postman Collection Item JSON

{
  "name": "Add Rules",
  "request": {
    "method": "POST",
    "header": [
    ],
    "body": {
      "mode": "raw",
      "raw": "{\n    \"add\": [\n        {\n            \"value\": \"bio_location:nyc\",\n            \"tag\": \"testtopic\"\n        }\n    ]\n}",
      "options": {
        "raw": {
          "language": "json"
        }
      }
    },
    "url": {
      "raw": "https://api.twitter.com/2/tweets/search/stream/rules",
      "protocol": "https",
      "host": [
        "api",
        "twitter",
        "com"
      ],
      "path": [
        "2",
        "tweets",
        "search",
        "stream",
        "rules"
      ]
    },
    "description": "Create filter rules. To create one or more rules, submit an add payload as an array of rules and operators.\n\n[Sign up](https://t.co/signup) for the Twitter API"
  },
  "response": [
    {
      "name": "400 - Bad Request (Delete)",
      "originalRequest": {
        "method": "POST",
        "header": [
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"delete\": [\n        {\n            \"ids\": [\n                \"1273636687768285186\"\n            ]\n        }\n    ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "https://api.twitter.com/2/tweets/search/stream/rules",
          "protocol": "https",
          "host": [
            "api",
            "twitter",
            "com"
          ],
          "path": [
            "2",
            "tweets",
            "search",
            "stream",
            "rules"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "cache-control",
          "value": "no-cache, no-store, max-age=0"
        },
        {
          "key": "content-disposition",
          "value": "attachment; filename=json.json"
        },
        {
          "key": "content-encoding",
          "value": "gzip"
        },
        {
          "key": "content-length",
          "value": "195"
        },
        {
          "key": "content-type",
          "value": "application/json; charset=utf-8"
        },
        {
          "key": "date",
          "value": "Thu, 09 Jul 2020 21:11:01 GMT"
        },
        {
          "key": "server",
          "value": "tsa_b"
        },
        {
          "key": "strict-transport-security",
          "value": "max-age=631138519"
        },
        {
          "key": "x-access-level",
          "value": "read"
        },
        {
          "key": "x-connection-hash",
          "value": "2973f79ee2e2cc52cf49ccd1a4a5006e"
        },
        {
          "key": "x-content-type-options",
          "value": "nosniff"
        },
        {
          "key": "x-frame-options",
          "value": "SAMEORIGIN"
        },
        {
          "key": "x-rate-limit-limit",
          "value": "450"
        },
        {
          "key": "x-rate-limit-remaining",
          "value": "447"
        },
        {
          "key": "x-rate-limit-reset",
          "value": "1594329886"
        },
        {
          "key": "x-response-time",
          "value": "375"
        },
        {
          "key": "x-tsa-request-body-time",
          "value": "0"
        },
        {
          "key": "x-xss-protection",
          "value": "0"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"errors\": [\n        {\n            \"parameters\": {\n                \"delete\": []\n            },\n            \"message\": \"JSON doesn't match expected schema\"\n        }\n    ],\n    \"title\": \"Invalid Request\",\n    \"detail\": \"One or more parameters to your request was invalid.\",\n    \"type\": \"https://api.twitter.com/2/problems/invalid-request\"\n}"
    },
    {
      "name": "403 Forbidden - Client Not Enrolled",
      "originalRequest": {
        "method": "POST",
        "header": [
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"add\": [\n        {\n            \"value\": \"tostones recipe\"\n        }\n    ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "https://api.twitter.com/2/tweets/search/stream/rules",
          "protocol": "https",
          "host": [
            "api",
            "twitter",
            "com"
          ],
          "path": [
            "2",
            "tweets",
            "search",
            "stream",
            "rules"
          ]
        }
      },
      "status": "Forbidden",
      "code": 403,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "content-disposition",
          "value": "attachment; filename=json.json"
        },
        {
          "key": "content-encoding",
          "value": "gzip"
        },
        {
          "key": "content-length",
          "value": "275"
        },
        {
          "key": "content-type",
          "value": "application/json; charset=utf-8"
        },
        {
          "key": "date",
          "value": "Thu, 18 Jun 2020 16:05:21 GMT"
        },
        {
          "key": "server",
          "value": "tsa_b"
        },
        {
          "key": "strict-transport-security",
          "value": "max-age=631138519"
        },
        {
          "key": "x-access-level",
          "value": "read"
        },
        {
          "key": "x-connection-hash",
          "value": "ea1117f7e689b25cdc0d514fc5c62ba8"
        },
        {
          "key": "x-content-type-options",
          "value": "nosniff"
        },
        {
          "key": "x-frame-options",
          "value": "SAMEORIGIN"
        },
        {
          "key": "x-rate-limit-limit",
          "value": "15"
        },
        {
          "key": "x-rate-limit-remaining",
          "value": "13"
        },
        {
          "key": "x-rate-limit-reset",
          "value": "1592497214"
        },
        {
          "key": "x-response-time",
          "value": "258"
        },
        {
          "key": "x-tsa-request-body-time",
          "value": "0"
        },
        {
          "key": "x-xss-protection",
          "value": "0"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"client_id\": \"16340226\",\n    \"required_enrollment\": \"Standard Basic\",\n    \"registration_url\": \"https://developer.twitter.com/en/account\",\n    \"title\": \"Client Forbidden\",\n    \"detail\": \"This request must be made using an approved developer account that is enrolled in the requested endpoint. Learn more by visiting our documentation.\",\n    \"reason\": \"client-not-enrolled\",\n    \"type\": \"https://api.twitter.com/2/problems/client-forbidden\"\n}"
    },
    {
      "name": "Success 200 - Errors for Invalid Rule",
      "originalRequest": {
        "method": "POST",
        "header": [
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"add\": [\n        {\n            \"value\": \"plantains or tostones or guacamole or arepas or tacos or mushrooms or porcini or hen of the woods or cremini or enoki or shiitake or carbonara or cacio e pepe or amatriciana or parmigiano reggiano or california burrito or chipotle or carne asada fries or laksa or hokkien mee or chili crab or nasi lemak or hainan chicken rice or kaya toast or bak kut teh or popiah or pisang goreng or curry puff or nasi uduk or martabak or fried chicken or bbq or kimchi or yukgaejang or galbitang or xiao long bao or pizza or ice cream sandwich\",\n            \"tag\": \"food\"\n        }\n    ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "https://api.twitter.com/2/tweets/search/stream/rules",
          "protocol": "https",
          "host": [
            "api",
            "twitter",
            "com"
          ],
          "path": [
            "2",
            "tweets",
            "search",
            "stream",
            "rules"
          ],
          "query": [
            {
              "key": "dry_run",
              "value": "true",
              "description": "Boolean. Set to true to test a the syntax of your rule without submitting it. This is useful if you want to check the syntax of a rule before removing one or more of your existing rules.",
              "disabled": true
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "content-disposition",
          "value": "attachment; filename=json.json"
        },
        {
          "key": "content-encoding",
          "value": "gzip"
        },
        {
          "key": "content-length",
          "value": "832"
        },
        {
          "key": "content-type",
          "value": "application/json; charset=utf-8"
        },
        {
          "key": "date",
          "value": "Thu, 18 Jun 2020 15:56:35 GMT"
        },
        {
          "key": "server",
          "value": "tsa_b"
        },
        {
          "key": "strict-transport-security",
          "value": "max-age=631138519"
        },
        {
          "key": "x-access-level",
          "value": "read"
        },
        {
          "key": "x-connection-hash",
          "value": "ea1117f7e689b25cdc0d514fc5c62ba8"
        },
        {
          "key": "x-content-type-options",
          "value": "nosniff"
        },
        {
          "key": "x-frame-options",
          "value": "SAMEORIGIN"
        },
        {
          "key": "x-rate-limit-limit",
          "value": "15"
        },
        {
          "key": "x-rate-limit-remaining",
          "value": "13"
        },
        {
          "key": "x-rate-limit-reset",
          "value": "1592496442"
        },
        {
          "key": "x-response-time",
          "value": "326"
        },
        {
          "key": "x-tsa-request-body-time",
          "value": "0"
        },
        {
          "key": "x-xss-protection",
          "value": "0"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"meta\": {\n        \"sent\": \"2020-06-18T15:56:35.056Z\",\n        \"summary\": {\n            \"created\": 0,\n            \"not_created\": 1,\n            \"valid\": 0,\n            \"invalid\": 1\n        }\n    },\n    \"errors\": [\n        {\n            \"value\": \"plantains or tostones or guacamole or arepas or tacos or mushrooms or porcini or hen of the woods or cremini or enoki or shiitake or carbonara or cacio e pepe or amatriciana or parmigiano reggiano or california burrito or chipotle or carne asada fries or laksa or hokkien mee or chili crab or nasi lemak or hainan chicken rice or kaya toast or bak kut teh or popiah or pisang goreng or curry puff or nasi uduk or martabak or fried chicken or bbq or kimchi or yukgaejang or galbitang or xiao long bao or pizza or ice cream sandwich\",\n            \"details\": [\n                \"Too many positive clauses in rule - 100.  The maximum allowed is 30 (at position 1)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 36)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 484)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 131)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 160)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 447)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 253)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 220)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 55)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 119)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 342)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 501)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 305)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 144)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 175)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 367)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 398)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 328)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 423)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 198)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 262)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 357)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 68)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 99)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 291)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 384)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 510)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 411)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 440)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 23)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 471)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 277)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 79)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 46)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 110)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 11)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 457)\",\n                \"Ambiguous use of or as a keyword. Use OR to logically join two clauses, or \\\"or\\\" to find occurrences of or in text (at position 232)\",\n                \"Rule 'plantains or tostones or guacamole or arepas or tacos or mushrooms or porcini or hen of the woods or cremini or enoki or shiitake or carbonara or cacio e pepe or amatriciana or parmigiano reggiano or california burrito or chipotle or carne asada fries or laksa or hokkien mee or chili crab or nasi lemak or hainan chicken rice or kaya toast or bak kut teh or popiah or pisang goreng or curry puff or nasi uduk or martabak or fried chicken or bbq or kimchi or yukgaejang or galbitang or xiao long bao or pizza or ice cream sandwich' exceeds the maximum length of a rule. It is 530 characters while the maximum allowed is 512 (at position 1)\"\n            ],\n            \"title\": \"UnprocessableEntity\",\n            \"type\": \"https://api.twitter.com/2/problems/invalid-rules\"\n        }\n    ]\n}"
    },
    {
      "name": "Success 200 - Delete Rule",
      "originalRequest": {
        "method": "POST",
        "header": [
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"delete\": {\n        \"ids\": [\n            \"1273636687768285186\"\n        ]\n    }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "https://api.twitter.com/2/tweets/search/stream/rules",
          "protocol": "https",
          "host": [
            "api",
            "twitter",
            "com"
          ],
          "path": [
            "2",
            "tweets",
            "search",
            "stream",
            "rules"
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "cache-control",
          "value": "no-cache, no-store, max-age=0"
        },
        {
          "key": "content-disposition",
          "value": "attachment; filename=json.json"
        },
        {
          "key": "content-encoding",
          "value": "gzip"
        },
        {
          "key": "content-length",
          "value": "101"
        },
        {
          "key": "content-type",
          "value": "application/json; charset=utf-8"
        },
        {
          "key": "date",
          "value": "Thu, 09 Jul 2020 21:13:18 GMT"
        },
        {
          "key": "server",
          "value": "tsa_b"
        },
        {
          "key": "strict-transport-security",
          "value": "max-age=631138519"
        },
        {
          "key": "x-access-level",
          "value": "read"
        },
        {
          "key": "x-connection-hash",
          "value": "2973f79ee2e2cc52cf49ccd1a4a5006e"
        },
        {
          "key": "x-content-type-options",
          "value": "nosniff"
        },
        {
          "key": "x-frame-options",
          "value": "SAMEORIGIN"
        },
        {
          "key": "x-rate-limit-limit",
          "value": "450"
        },
        {
          "key": "x-rate-limit-remaining",
          "value": "446"
        },
        {
          "key": "x-rate-limit-reset",
          "value": "1594329886"
        },
        {
          "key": "x-response-time",
          "value": "408"
        },
        {
          "key": "x-tsa-request-body-time",
          "value": "1"
        },
        {
          "key": "x-xss-protection",
          "value": "0"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"meta\": {\n        \"sent\": \"2020-07-09T21:13:18.284Z\",\n        \"summary\": {\n            \"deleted\": 1,\n            \"not_deleted\": 0\n        }\n    }\n}"
    },
    {
      "name": "Success 201 - Created List of Rules",
      "originalRequest": {
        "method": "POST",
        "header": [
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"add\": [\n        {\n            \"value\": \"puppy has:media\",\n            \"tag\": \"puppies with media\"\n        },\n        {\n            \"value\": \"meme has:images\"\n        }\n    ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "https://api.twitter.com/2/tweets/search/stream/rules",
          "protocol": "https",
          "host": [
            "api",
            "twitter",
            "com"
          ],
          "path": [
            "2",
            "tweets",
            "search",
            "stream",
            "rules"
          ],
          "query": [
            {
              "key": "dry_run",
              "value": "",
              "description": "Boolean. Set to true to test a the syntax of your rule without submitting it. This is useful if you want to check the syntax of a rule before removing one or more of your existing rules.",
              "disabled": true
            }
          ]
        }
      },
      "status": "Created",
      "code": 201,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "content-disposition",
          "value": "attachment; filename=json.json"
        },
        {
          "key": "content-encoding",
          "value": "gzip"
        },
        {
          "key": "content-length",
          "value": "190"
        },
        {
          "key": "content-type",
          "value": "application/json; charset=utf-8"
        },
        {
          "key": "date",
          "value": "Thu, 18 Jun 2020 15:20:24 GMT"
        },
        {
          "key": "server",
          "value": "tsa_b"
        },
        {
          "key": "strict-transport-security",
          "value": "max-age=631138519"
        },
        {
          "key": "x-access-level",
          "value": "read"
        },
        {
          "key": "x-connection-hash",
          "value": "d3ecb7f3763b04c3289e94d8bdbbf298"
        },
        {
          "key": "x-content-type-options",
          "value": "nosniff"
        },
        {
          "key": "x-frame-options",
          "value": "SAMEORIGIN"
        },
        {
          "key": "x-rate-limit-limit",
          "value": "15"
        },
        {
          "key": "x-rate-limit-remaining",
          "value": "13"
        },
        {
          "key": "x-rate-limit-reset",
          "value": "1592493964"
        },
        {
          "key": "x-response-time",
          "value": "354"
        },
        {
          "key": "x-tsa-request-body-time",
          "value": "0"
        },
        {
          "key": "x-xss-protection",
          "value": "0"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"data\": [\n        {\n            \"value\": \"meme has:images\",\n            \"id\": \"1273636687768285186\"\n        },\n        {\n            \"value\": \"puppy has:media\",\n            \"tag\": \"puppies with media\",\n            \"id\": \"1273636687768285187\"\n        }\n    ],\n    \"meta\": {\n        \"sent\": \"2020-06-18T15:20:24.063Z\",\n        \"summary\": {\n            \"created\": 2,\n            \"not_created\": 0,\n            \"valid\": 2,\n            \"invalid\": 0\n        }\n    }\n}"
    },
    {
      "name": "Success 201 - Create Rules with Dry Run",
      "originalRequest": {
        "method": "POST",
        "header": [
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"add\": [\n        {\n            \"value\": \"tostones recipe\"\n        }\n    ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "https://api.twitter.com/2/tweets/search/stream/rules?dry_run=true",
          "protocol": "https",
          "host": [
            "api",
            "twitter",
            "com"
          ],
          "path": [
            "2",
            "tweets",
            "search",
            "stream",
            "rules"
          ],
          "query": [
            {
              "key": "dry_run",
              "value": "true",
              "description": "Boolean. Set to true to test a the syntax of your rule without submitting it. This is useful if you want to check the syntax of a rule before removing one or more of your existing rules."
            }
          ]
        }
      },
      "status": "Created",
      "code": 201,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "content-disposition",
          "value": "attachment; filename=json.json"
        },
        {
          "key": "content-encoding",
          "value": "gzip"
        },
        {
          "key": "content-length",
          "value": "157"
        },
        {
          "key": "content-type",
          "value": "application/json; charset=utf-8"
        },
        {
          "key": "date",
          "value": "Thu, 18 Jun 2020 16:00:34 GMT"
        },
        {
          "key": "server",
          "value": "tsa_b"
        },
        {
          "key": "strict-transport-security",
          "value": "max-age=631138519"
        },
        {
          "key": "x-access-level",
          "value": "read"
        },
        {
          "key": "x-connection-hash",
          "value": "ea1117f7e689b25cdc0d514fc5c62ba8"
        },
        {
          "key": "x-content-type-options",
          "value": "nosniff"
        },
        {
          "key": "x-frame-options",
          "value": "SAMEORIGIN"
        },
        {
          "key": "x-rate-limit-limit",
          "value": "15"
        },
        {
          "key": "x-rate-limit-remaining",
          "value": "12"
        },
        {
          "key": "x-rate-limit-reset",
          "value": "1592496442"
        },
        {
          "key": "x-response-time",
          "value": "293"
        },
        {
          "key": "x-tsa-request-body-time",
          "value": "0"
        },
        {
          "key": "x-xss-protection",
          "value": "0"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"data\": [\n        {\n            \"value\": \"tostones recipe\",\n            \"id\": \"1273646795642421249\"\n        }\n    ],\n    \"meta\": {\n        \"sent\": \"2020-06-18T16:00:33.972Z\",\n        \"summary\": {\n            \"created\": 1,\n            \"not_created\": 0,\n            \"valid\": 1,\n            \"invalid\": 0\n        }\n    }\n}"
    },
    {
      "name": "400 - Bad Request (Create)",
      "originalRequest": {
        "method": "POST",
        "header": [
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"add\": [\n        {\n            \"values\": \"puppy has:media\"\n        }\n    ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "https://api.twitter.com/2/tweets/search/stream/rules",
          "protocol": "https",
          "host": [
            "api",
            "twitter",
            "com"
          ],
          "path": [
            "2",
            "tweets",
            "search",
            "stream",
            "rules"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "content-disposition",
          "value": "attachment; filename=json.json"
        },
        {
          "key": "content-encoding",
          "value": "gzip"
        },
        {
          "key": "content-length",
          "value": "181"
        },
        {
          "key": "content-type",
          "value": "application/json; charset=utf-8"
        },
        {
          "key": "date",
          "value": "Thu, 18 Jun 2020 16:08:19 GMT"
        },
        {
          "key": "server",
          "value": "tsa_b"
        },
        {
          "key": "strict-transport-security",
          "value": "max-age=631138519"
        },
        {
          "key": "x-access-level",
          "value": "read"
        },
        {
          "key": "x-connection-hash",
          "value": "ea1117f7e689b25cdc0d514fc5c62ba8"
        },
        {
          "key": "x-content-type-options",
          "value": "nosniff"
        },
        {
          "key": "x-frame-options",
          "value": "SAMEORIGIN"
        },
        {
          "key": "x-rate-limit-limit",
          "value": "15"
        },
        {
          "key": "x-rate-limit-remaining",
          "value": "13"
        },
        {
          "key": "x-rate-limit-reset",
          "value": "1592497381"
        },
        {
          "key": "x-response-time",
          "value": "275"
        },
        {
          "key": "x-tsa-request-body-time",
          "value": "0"
        },
        {
          "key": "x-xss-protection",
          "value": "0"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"errors\": [\n        {\n            \"parameters\": {\n                \"add.value\": []\n            },\n            \"message\": \"field is required\"\n        }\n    ],\n    \"title\": \"Invalid Request\",\n    \"detail\": \"One or more parameters to your request was invalid.\",\n    \"type\": \"https://api.twitter.com/2/problems/invalid-request\"\n}"
    }
  ]
}