Edit a business
This endpoint allows you to update business information. Only the parameters provided will be updated; others will be ignored.
Endpoint
POST https://canadamotorjobs.com/api/v1/{locale}/businesses/edit
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
id | string | The business identifier | Required or ref_id |
ref_id | string | The business identifier in your system | Required or id |
api_token | string | Your API key, if you are not using the bearer token | Required if not using bearer token |
with_data | boolean | Whether you want to receive business data in addition to the response | No |
name | string | The business name | No |
category | string | The business category | No |
logo | base64 | The business logo | No |
street_address | string | The business address | No |
city | string | The city | No |
province | string | The province | No |
country | string | The country | No |
postal_code | string | The postal code | No |
latitude | float | The latitude | No |
longitude | float | The longitude | No |
phone | string | The phone number | No |
email_facturation | string | The billing email address | No |
a_propos | markdown | Business description text | No |
why_work_with_us | markdown | Text on why work with this business | No |
working_conditions_custom | markdown | Working conditions text, ideally as a bullet list | No |
Please only provide the parameters that need to be updated; others will be ignored. To avoid accidentally deleting data, please use an empty string "" for parameters that should be set to null.
Response
Returns the request status and all business information with the updated information if the with_data parameter is true.
Response codes
| Code | Message | Description |
|---|---|---|
BUSINESS_UPDATED | The business was updated successfully | Returns the updated business information |
NOT_FOUND | The business was not found | Returns an error if the business does not exist |
INVALID_PARAMETERS | The parameters provided are invalid | Returns an error if the parameters provided are invalid |
NOT_AUTHORIZED | You are not authorized to perform this action | Returns an error if you are not authorized to perform this action |
ERROR_SERVER | An error occurred while updating the business | Returns an error if an error occurred while updating the business |
Example response with invalid parameters
{
"success": false,
"code": "INVALID_PARAMETERS",
"message": "The parameters provided are invalid",
"errors": {
"name": "The name cannot be empty",
"logo": "Unable to process the image provided",
"etc...": "The rest of the parameters that caused the update to fail"
}
}
Code example
Changing the business address and removing the why work with us text
// Laravel PHP
use Illuminate\Support\Facades\Http;
$response = Http::withHeaders([
"Authorization" => "Bearer your_api_token"
])->post("https://canadamotorjobs.com/api/v1/en/businesses/edit", [
"ref_id" => "1234567890", // The business identifier in your system
"api_token" => "your_api_token" ?? null // Your API key, if you are not using the bearer token
"street_address" => "123 Saint Catherine Street",
"city" => "Montreal",
"postal_code" => "H3Z 2Y7",
"latitude" => 45.5017,
"longitude" => -73.5673,
"why_work_with_us" => "",//<= removes the why work with this business text
]);