Entitlement API documentation version v2
https://client-api.{environment}/api/entitlement/{version}
- environment: required(one of magine.com, tvoli.com - default: magine.com)
- version: required(v2)
/users/{userId}/offers
get /users/{userId}/offers
URI Parameters
- userId: required(string)
Headers
- Magine-AccessToken: required(string)
A token that identifies a specific partner
Example:
25b70ae1-d2bd-4ae7-85f4-62026580c866
- Authorization: required(string)
Bearer internal:{secret}
Body
Media type: application/json
Type: array of object
Items: OfferEntitlement
- offerId: required(string)
Example:
6NBYG9ZA6DEXSULCVDQQCKGFEOFR
- purchasedAt: required(string)
Example:
2017-12-01T00:00:00Z
- type: required(one of default, est, pass, rental", subscription, thirdparty)
- expiry: (string)
Example:
2017-12-01T00:00:00Z
post /users/{userId}/offers
URI Parameters
- userId: required(string)
Headers
- Magine-AccessToken: required(string)
A token that identifies a specific partner
Example:
25b70ae1-d2bd-4ae7-85f4-62026580c866
- Authorization: required(string)
Bearer internal:{secret}
Body
Media type: application/json
Type: object
Properties- offerId: required(string)
Example:
6NBYG9ZA6DEXSULCVDQQCKGFEOFR
- expiry: (string)
Example:
2017-12-01T00:00:00Z
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- offerId: required(string)
Example:
6NBYG9ZA6DEXSULCVDQQCKGFEOFR
- purchasedAt: required(string)
Example:
2017-12-01T00:00:00Z
- type: required(one of default, est, pass, rental", subscription, thirdparty)
- expiry: (string)
Example:
2017-12-01T00:00:00Z
HTTP status code 400
Bad Request
delete /users/{userId}/offers/{offerId}
URI Parameters
- userId: required(string)
- offerId: required(string)
Example:
6NBYG9ZA6DEXSULCVDQQCKGFEOFR
Headers
- Magine-AccessToken: required(string)
A token that identifies a specific partner
Example:
25b70ae1-d2bd-4ae7-85f4-62026580c866
- Authorization: required(string)
Bearer internal:{secret}
/users/{userId}/thirdparty/{providerName}/offers/set
post /users/{userId}/thirdparty/{providerName}/offers/set
URI Parameters
- userId: required(string)
- providerName: required(string)
Headers
- Authorization: required(string)
Bearer internal:{secret}
Body
Media type: application/json
Type: object
Properties- providerIds: required(array of union)
Examples:
withIntegers:
{
"providerIds": [123, 321]
}
withStrings:
{
"providerIds": ["abc", "123"]
}
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- removed: required(array of OfferEntitlement)
Items: OfferEntitlement
- offerId: required(string)
Example:
6NBYG9ZA6DEXSULCVDQQCKGFEOFR
- purchasedAt: required(string)
Example:
2017-12-01T00:00:00Z
- type: required(one of default, est, pass, rental", subscription, thirdparty)
- expiry: (string)
Example:
2017-12-01T00:00:00Z
- offerId: required(string)
- added: required(array of OfferEntitlement)
Items: OfferEntitlement
- offerId: required(string)
Example:
6NBYG9ZA6DEXSULCVDQQCKGFEOFR
- purchasedAt: required(string)
Example:
2017-12-01T00:00:00Z
- type: required(one of default, est, pass, rental", subscription, thirdparty)
- expiry: (string)
Example:
2017-12-01T00:00:00Z
- offerId: required(string)
- failures: required(array of ThirdPartyOfferEntitlementsFailure)
Items: ThirdPartyOfferEntitlementsFailure
- providerId: required(string)
- error: required(string)
Examples:
nothingHasChanged:
{
"removed": [],
"added": [],
"failures": []
}
oneRemoved:
{
"removed": [
{
"offerId": "AONQ98XWCEF63LYO0DHZAXA8EOFR",
"purchasedAt": "2018-10-03T06:53:22.584Z",
"type": "est"
}
],
"added": [],
"failures": []
}
oneFailure:
{
"removed": [],
"added": [],
"failures": [
{
"providerId": "foo",
"error": "Could not find offer with providerId=foo"
}
]
}
HTTP status code 400
Bad Request
/users/{userId}/thirdparty/{providerName}/offers/add
post /users/{userId}/thirdparty/{providerName}/offers/add
URI Parameters
- userId: required(string)
- providerName: required(string)
Headers
- Authorization: required(string)
Bearer internal:{secret}
Body
Media type: application/json
Type: object
Properties- providerIds: required(array of union)
Examples:
withIntegers:
{
"providerIds": [ 123 ]
}
withStrings:
{
"providerId": [ "abc" ]
}
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- added: required(array of OfferEntitlement)
Items: OfferEntitlement
- offerId: required(string)
Example:
6NBYG9ZA6DEXSULCVDQQCKGFEOFR
- purchasedAt: required(string)
Example:
2017-12-01T00:00:00Z
- type: required(one of default, est, pass, rental", subscription, thirdparty)
- expiry: (string)
Example:
2017-12-01T00:00:00Z
- offerId: required(string)
- failures: required(array of ThirdPartyOfferEntitlementsFailure)
Items: ThirdPartyOfferEntitlementsFailure
- providerId: required(string)
- error: required(string)