機械翻訳について

ストアド問合せ

エンティティのストアド問合せの取得(エンティティの保存済検索)

指定されたエンティティのすべての保存済問合せを取得します。 エンティティのカンマ区切りリストを指定して、そのエンティティ全体(アカウントや商談など)の問合せを取得できます。

レスポンス・ペイロードの例

{
    "items": [
        {
            "_entity": "Account",
            "name": "All Accounts",
            "description": null,
            "queryUuid": "59783e65-0513-4169-9fae-db9d7d1b105c",
            "access": "Public",
            "isDefault": true,
            "isUpdatable": false,
            "user": null,
            "keywords": null,
            "sort": [
                {
                    "attribute": "PartyUniqueName",
                    "direction": "ascending"
                }
            ],
            "q": null,
            "keywordsFields": [
                "PartyUniqueName",
                "PrimaryAddress",
                "PrimaryContact",
                "PrimaryIndustry",
                "Owner"
            ],
            "aggregations": {
                "PrimaryIndustry": {
                    "ignore": true,
                    "terms": {
                        "attribute": "PrimaryIndustry",
                        "minBucketCount": 5,
                        "maxNumberOfBuckets": 5,
                        "other": false,
                        "missing": false,
                        "localize": true
                    }
                },
                "Owner": {
                    "ignore": true,
                    "terms": {
                        "attribute": "Owner",
                        "minBucketCount": 5,
                        "maxNumberOfBuckets": 5,
                        "other": false,
                        "missing": false,
                        "localize": true
                    }
                },
                "SalesProfileType": {
                    "ignore": true,
                    "terms": {
                        "attribute": "SalesProfileType",
                        "minBucketCount": 5,
                        "maxNumberOfBuckets": 5,
                        "other": false,
                        "missing": false,
                        "localize": true
                    }
                }
            },
            "fields": null,
            "excludeFields": null,
            "applicationData": {
                "461e5791-9f15-4cd1-b5cd-19e8480cbce4": null
            },
            "highlights": null,
            
...
}

問合せの保存

次に、問合せを格納するサンプル・ペイロードを示します。 格納されたプリファレンス、名前およびプリファレンス・タイプの問合せ結果を入力する必要があります。

リクエスト・ペイロードの例

{   
    "name":"demo json parser",
    "entity":"Account",
    "keywords":"parser",
    "sort": [{ "attribute":"PartyUniqueName","direction":"ascending"}],
    "fields":["PartyUniqueName","PrimaryAddress"],
    "q":{"op": "$all" , "attribute": "PartyUniqueName", "value": "Technologies United"},
    "excludeFields" : ["PrimaryIndustry"],
    "aggregations":{
        "PrimaryIndustry":{
            "ignore": true,
            "terms":{
                "attribute": "PrimaryIndustry",
                "maxNumberOfBuckets" : 5,
                "includeTerms":["1022","1012"],
                "excludeTerms":["1234"],
                "other": true,   
                "missing": true,
                "localize": true
            }
        },
        "CreationDate":{
            "ignore":true,
            "range":{
                "attribute":"CreationDate",
                "ranges":[
                    {"key": "ThisQuarter", "from": "now/m-3m", "to": "now"},
                    {"key": "NextQuarter", "from": "now", "to": "now/m+3m"},
                    {"key": "ThisYear", "from": "now/y", "to": "now/y+1y"},
                    {"key": "LastQuarter", "from": "now/m-6m", "to": "now/m-3m"},
                    {"key": "LastYear", "from": "now/y-1y", "to": "now/y"}
                ]
            }
        }
    },
    "keywordsFields":["PrimaryIndustry"],
    "applicationData": {
                "461e5791-9f15-4cd1-b5cd-19e8480cbce6":{"hello":{"Nice":"Work"}}
            },
    "highlights" : {
        "pre": ["<em>"],
        "post": ["</em>"],
        "fields":["PartyUniqueName"]
    }
}

問合せの更新

ストアド問合せを更新する場合。 名前は必須です。

cURLコマンド

https://servername.fa.us2.oraclecloud.com/crmRestApi/searchResources/11.13.18.05/custom-actions/queries/59783e65-0513-4169-9fae-db9d7d1b105c?metaModelUuid=81f4c054-90c6-45a0-a096-beec3ad68d42&entity=Account

リクエスト・ペイロードの例

{   
    "name":"demo json parser",
    "entity":"Account",
    "keywords":"parser",
    "sort": [{ "attribute":"PartyUniqueName","direction":"ascending"}],
    "fields":["PartyUniqueName","PrimaryAddress"],
    "q":{"op": "$all" , "attribute": "PartyUniqueName", "value": "Technologies United"},
    "excludeFields" : ["PrimaryIndustry"],
    "aggregations":{
        "CreationDate":{
            "range":{
                "attribute":"CreationDate",
                "ranges":[
                    {"key": "ThisQuarter", "from": "now/m-3m", "to": "now"},
                    {"key": "NextQuarter", "from": "now", "to": "now/m+3m"},
                    {"key": "ThisYear", "from": "now/y", "to": "now/y+1y"},
                    {"key": "LastQuarter", "from": "now/m-6m", "to": "now/m-3m"},
                    {"key": "LastYear", "from": "now/y-1y", "to": "now/y"}
                ]
            }
        }
    },
    "keywordsFields":["PrimaryIndustry"]
}