Merge two custom object records
client.Merge.MergeObjectValues(ctx, entitySlug, body) (*MergeMergeObjectValuesResponse, error)
POST/v1/objects/{entitySlug}/merge
Merges two records of the specified custom object type into one. The primary record retains its ID; the duplicate is soft-deleted. Both records must belong to the custom object type named in the path.
Required scopes: custom_objects:update + custom_objects:delete
Rate limit category: Write
Merge two custom object records
package main
import (
"context"
"fmt"
"github.com/Lightfld/lightfield-go"
"github.com/Lightfld/lightfield-go/option"
)
func main() {
client := githubcomlightfldlightfieldgo.NewClient(
option.WithAPIKey("My API Key"),
)
mergeMergeObjectValuesResponse, err := client.Merge.MergeObjectValues(
context.TODO(),
"entitySlug",
githubcomlightfldlightfieldgo.MergeMergeObjectValuesParams{
DuplicateID: "duplicateId",
PrimaryID: "primaryId",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", mergeMergeObjectValuesResponse.Merge)
}
{
"merge": {
"id": "id",
"status": "status"
},
"primary": {
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
]
}
},
"updatedAt": "updatedAt",
"externalId": "externalId"
},
"summary": {
"fieldWriteCount": -9007199254740991,
"syncRepointedCount": -9007199254740991,
"warnings": [
"string"
]
}
}Returns Examples
{
"merge": {
"id": "id",
"status": "status"
},
"primary": {
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
]
}
},
"updatedAt": "updatedAt",
"externalId": "externalId"
},
"summary": {
"fieldWriteCount": -9007199254740991,
"syncRepointedCount": -9007199254740991,
"warnings": [
"string"
]
}
}