Scope

The Scope clause is used to specify a list of fields you want to get from Maximizer.

Fields

The Fields (object under the Scope) is composed of a list of the fields.

{ 
    "Scope": {
        "Fields": {
            "Key": 1,
            "Objective": 1,
            "Udf/$NAME(My UDF)": 1,
            "$SUM(CorporateRevenue)": 1
         }
    }
}

In this example, we request to return fields: "Key," "Objective," the User-defined field "Udf/$NAME(My UDF)," and a built-in function $SUM().

Scope - Return a list of contacts with names

// POST https://api.maximizer.com/octopus/Read
// Authorization: Bearer <token>
{
    "AbEntry": {
        "Scope": {
            // Check the list of the available fields by using Metadata for the AbEntry object
            "Fields": {
                "Key": 1,
                "FirstName": 1,
                "LastName": 1
            }
        },
        "Criteria": {
            "SearchQuery": {
                "Type": {
                    "$EQ": "Contact"
                }
            },
            "Top": 3
        }
    },
    "Configuration": {
        "Drivers": {
            "IAbEntrySearcher": "Maximizer.Model.Access.Sql.AbEntrySearcher"
        }
    }
}

Scope - Return a list of contacts with UDFs

// POST https://api.maximizer.com/octopus/Read
// Authorization: Bearer <token>
{
    "AbEntry": {
        "Scope": {
            // Check the list of the available fields by using Metadata for the AbEntry object
            "Fields": {
                "Key": 1,
                "FirstName": 1,
                "LastName": 1,
                // You can get a UDF field by using its name
                "Udf/$NAME(My UDF)": 1,
                // OR you can get it by using its type id
                "Udf/$TYPEID(111)": 1
            }
        },
        "Criteria": {
            "SearchQuery": {
                "Type": {
                    "$EQ": "Contact"
                }
            },
            "Top": 3
        }
    },
    "Configuration": {
        "Drivers": {
            "IAbEntrySearcher": "Maximizer.Model.Access.Sql.AbEntrySearcher"
        }
    }
}