POST
/
curl --request POST \
  --url https://updatelocation.api.velt.dev/
{
  "result": {
    "status": "success",
    "message": "Location updated.",
    "data": null
  }
}

Updating a Location

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://updatelocation.api.velt.dev/ 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
        }
    }
}

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"
            }
        }
    }
}
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