menu
Is this helpful?

# SQL쿼리 생성 API

호출 방법 설명은 Open API 문서를 참조하십시오.

# 1. SQL쿼리 생성 유저 테이블

인터페이스 URL

/open/get-sql-for-user-search?token=xxx&projectId=377

요청 방법

POST

콘텐츠 유형

application/json

요청 쿼리 파라미터

Parameter name

Sample value

Parameter type

Is required

Parameter description

token

xxx

String

Yes

token

projectId

0

Integer

Yes

Project ID

요청 본문 파라미터

{
  "filter": {
      "filterType": "COMPOUND",
      "relation": "and",
      "filts": [
        {
          "filterType": "SIMPLE",
          "tableType": "user",
          "columnName": "city",
          "comparator": "equal",
          "ftv": [
            "Shanghai"
          ]
        },
        {
          "filterType": "SIMPLE",
          "tableType": "user",
          "columnName": "companynature",
          "comparator": "equal",
          "ftv": [
            "private-owned"
          ]
        }
      ]
  },
  "selectAllColumns": false,
  "selectColumns": [
     "#account_id", "#distinct_id"
  ]
}

$$Parameter name

Sample value

Parameter type

Is required

Parameter description

selectAllColumns

false

Boolean

No

Whether to query all fields, default false

selectColumns

["#account_id", "#distinct_id"]

List

No

List of query field names

filter

-

List

Yes

Attribute filter

filter.filterType

COMPOUND

String

No

Filter

  • COMPOUND: composite type

  • SIMPLE: Simple type

filter.relation

and

String

No

Filter logical relationships

filter.filts

-

Object

No

Filter object list

filter.filts.filterType

SIMPLE

String

No

Filter

  • COMPOUND: composite type

  • SIMPLE: Simple type

filter.filts.tableType

user

String

No

Event: event attribute, user: user feature

filter.filts.columnName

city

String

Yes

Field name

filter.filts.comparator

equal

String

No

Comparison operator

filter.filts.ftv

["Private"]

List

No

Filtered value list

성공적인 요청 예시

{
  "data": {
    "sql": "select \"#user_id\", \"#account_id\", \"#distinct_id\" from (v_user_377) where (\"city\" IN ('上海市')) and (\"companynature\" IN ('民营'))"
  },
  "return_code": 0,
  "return_message": "success"
}

$$Parameter name

Sample value

Parameter type

Parameter description

data

-

Object

Return result

data.sql

"select \"#user_id\", \"#account_id\", \"#distinct_id\" from (v_user_377) where (\"city\" IN ('Shanghai')) and (\"companynature\" IN ('private owned'))"

String

SQL statement

return_code

0

Integer

Return code

return_message

success

String

Return information

오류 요청 예시

{
    "return_code": -1008,
    "return_message": "error description"
}

Parameter name

Sample value

Parameter type

Parameter description

return_code

-1008

Integer

Return code

return_message

Error description

String

Return information