POST
/
updatelocation

You can update a Location's object fields while keeping the location id the same using an api call.

To update the location, send a POST request to https://api.velt.dev/updatelocation with the following body data.

Body:

{
    "data": {
        "apiKey": "YOUR_API_KEY",
        "authToken": "YOUR_AUTH_TOKEN",
        "documentId": "YOUR_DOCUMENT_ID",
        "migrate": {
            "oldLocation": YOUR_OLD_LOCATION_OBJECT_HERE,
            "newLocation": YOUR_NEW_LOCATION_OBJECT_HERE
        },
        "merge" : true
    }
}

Not sure where find your Auth Token? You can follow these steps to generate your Auth Token.

Success Response:

{
  "result": {
    "status": "success",
    "message": "Location updated.",
    "data": null
  }
}

Failure Response:

{
  "error": {
    "message": "Auth Token not found.",
    "status": "INVALID_ARGUMENT"
  }
}

Example

For example, if your current location looks like this:

{
  "id": "scene_1",
  "locationName": "Untitled scene"
}

And you want to change it to this:

{
  "id": "scene_1",
  "locationName": "White scene"
}

Then you your body data should look like this:

{
    "data": {
        "apiKey": "YOUR_API_KEY",
        "authToken": "YOUR_AUTH_TOKEN",
        "documentId": "YOUR_DOCUMENT_ID",
        "migrate": {
            "oldLocation": {
                "id": "scene_1",
                "locationName": "Untitled scene"
            },
            "newLocation": {
                "id": "scene_1",
                "locationName": "White scene"
            },
            "merge": true
        }
    }
}

Merge Flag

Set the merge flag to true if you want to merge the new location fields into the old location fields.

Set the flag to false if you want the new location object to completely replace the old location object.

result
object

Response result

message
string

Status description message for the response

status
string

Status for the response

data
object

Contains data for the response