Guides
Errors
The two error schemas of the Marketing API, the most common validation codes, the authentication, version and Rest.li errors and Mimicr's 501.
The Marketing API has two error schemas. Accounts, account users, groups, campaigns and creatives use the new schema, with a code and per-field details; the other resources use the old one, with only status, serviceErrorCode and message.
New schema
{
"status": 400,
"serviceErrorCode": 10007,
"code": "FIELD_VALUE_TOO_LOW",
"message": "/Campaign/dailyBudget/amount value 5.0 can't be lower than 50.00",
"errorDetailType": "com.linkedin.common.error.BadRequest",
"errorDetails": {
"inputErrors": [
{
"code": "FIELD_VALUE_TOO_LOW",
"description": "/Campaign/dailyBudget/amount value 5.0 can't be lower than 50.00",
"input": { "inputPath": { "fieldPath": "/Campaign/dailyBudget/amount" }, "value": { "decimalValue": "5.0" } },
"minValue": "50.00"
}
]
}
}With more than one error, code is MULTIPLE_VALIDATIONS_FAILED, the message is "Multiple errors occurred during the input validation. Please see errorDetails for more information." and each error comes in errorDetails.inputErrors. Cross-field errors come in conditionalInputErrors. fieldPath starts with /Account/, /CampaignGroup/, /Campaign/ or /Creative/; targeting facets use parameterPath.
Old schema
{ "status": 400, "serviceErrorCode": 100, "message": "At least one of the following facets must be provided: accounts, campaignGroups, campaigns, creatives, shares, companies" }Some old-schema errors carry a code: VERSION_MISSING, NONEXISTENT_VERSION, ACCESS_DENIED, USER_NOT_AUTHORIZED, TOO_MANY_REQUESTS.
Common validation codes
| Code | When |
|---|---|
MISSING_FIELD | A required field is missing (locale, targetingCriteria, dailyBudget/totalBudget…) |
CONDITIONAL_MISSING_FIELD | A field another one requires is missing (runSchedule.end with totalBudget) |
FIELD_VALUE_TOO_LOW, FIELD_VALUE_TOO_HIGH | Below a budget or bid minimum; over an entity limit |
CURRENCY_MISMATCH | Currency other than the account's |
INVALID_CAMPAIGN_CONFIGURATION | Objective, format, type, optimization target and cost type don't fit |
STATUS_CHANGE_NOT_ALLOWED, INVALID_STATUS_TRANSITION | Status change not allowed |
FIELD_NOT_ALLOWED, IMMUTABLE_FIELD | Read-only or immutable field, or a field of a newer version |
AUDIENCE_SIZE_TOO_SMALL | Activating with an audience under 300 |
CTA_REQUIRED_FOR_LEAD_GEN | Lead generation creative without leadgenCallToAction |
DELETE_NOT_ALLOWED, DELETE_ALLOWED_ONLY_FOR_DRAFT_STATUS | Deleting something that isn't DRAFT |
TEST_ACCOUNT_LIMIT_REACHED | Second test account of the app |
Messages follow LinkedIn's templates, with the values filled in. The reference of each route lists its errors.
Authentication, permission, version and protocol
| HTTP | Body | Cause |
|---|---|---|
| 400 | VERSION_MISSING | No LinkedIn-Version |
| 400 | "Invalid query parameters passed to request" | 2.0 syntax without X-Restli-Protocol-Version, or an unencoded URN |
| 400 | "Invalid request: missing X-RestLi-Method header for partial update" | POST to a key without X-RestLi-Method |
| 401 | "Empty oauth2_access_token" | No token |
| 401 | 65600 INVALID_ACCESS_TOKEN, 65601 REVOKED_ACCESS_TOKEN, 65602 EXPIRED_ACCESS_TOKEN | Invalid, revoked or expired token |
| 403 | ACCESS_DENIED | Missing scope |
| 403 | NO_PERMISSION_ON_ENTITY | Role too low, or an account outside the development tier's list |
| 404 | NOT_FOUND | Doesn't exist, or an account the member has no role on |
| 426 | NONEXISTENT_VERSION | Sunset, unknown or unreleased version |
| 429 | TOO_MANY_REQUESTS | Daily quota reached (see Rate limits) |
OAuth errors are different: {"error": "invalid_request", "error_description": "…"} (see Authentication). The Conversions API answers 422 {"status": 422, "message": "ERROR :: /conversionHappenedAt :: …"} on schema errors and 400 "Validation failed because […]" on data errors (see Conversions API). Lead Sync uses 401 instead of 403 for missing permission on leads and forms.
Server errors and out of scope
| HTTP | code | When |
|---|---|---|
| 408 | TIMEOUT | analytics chaos |
| 409 | CONFLICT "Write Conflict" | api chaos: concurrent update |
| 500 | INTERNAL_ERROR | Chaos, or the [falha-simulada] trigger |
| 501 | NOT_IMPLEMENTED | Route or feature outside Mimicr's core |
| 503 | UNDER_MAINTENANCE | api chaos |
| 504 | "Gateway Timeout" | api chaos |
{ "status": 501, "serviceErrorCode": 0, "code": "NOT_IMPLEMENTED", "message": "Not simulated by Mimicr: GET /rest/dmpSegments is outside the integration core." }Chaos with apiErrorWhen: after processes the write and answers 500: the "created but reported failed" case. Since creates aren't idempotent, search before retrying.