Unable to update pricing for plan in sandbox account (PRICING_SCHEME_UPDATE_NOT_ALLOWED) in paypal API - paypal-sandbox

Unable to update pricing for plan in sandbox account (PRICING_SCHEME_UPDATE_NOT_ALLOWED)
Request:-
https://api-m.sandbox.paypal.com/v1/billing/plans/P-5TD04514DU568400GMDCGH2I/update-pricing-schemes
{
"pricing_schemes": [{
"billing_cycle_sequence": 2,
"pricing_scheme": {
"fixed_price": {
"value": "50",
"currency_code": "USD"
}
}
}
]
}
Response:-
{
"name": "UNPROCESSABLE_ENTITY",
"message": "The requested action could not be performed, semantically incorrect, or failed business validation.",
"debug_id": "1f4c7375963cb",
"details": [
{
"issue": "PRICING_SCHEME_UPDATE_NOT_ALLOWED",
"description": "Pricing scheme update is not allowed for the plan."
}
],
"links": [
{
"href": "#",
"rel": "information_link",
"method": "GET"
}
]
}

As the error states, updating the plan's pricing scheme is not allowed. It is not listed as one of the patchable fields.
If you need a new pricing scheme, create a new plan.

Related

Sending a request to /adCreativesV2 entity doesn't return all the fields

We are in the process of designing a custom build report for our client and have recently stumbled upon a behavior which we could not puzzle. Basically, we are not getting returned the following fields
ad_creative_name
ad_creative_text
ad_creative_title
when sending a GET request as follows:
https://api.linkedin.com/v2/adCreativesV2/136236994?projection=(*,reference~(*))
We're getting a 200 OK response as per below:
"variables": {
"data": {
"com.linkedin.ads.SponsoredInMailCreativeVariables": {
"content": "urn:li:adInMailContent:5139314"
}
}
},
"test": false,
"servingStatuses": [
"RUNNABLE"
],
"type": "SPONSORED_INMAILS",
"version": {
"versionTag": "6"
},
"reference": "urn:li:adInMailContent:5139314",
"changeAuditStamps": {
"lastModified": {
"time": 1624098658000
},
"created": {
"time": 1624035613000
}
},
"review": {
"reviewStatus": "APPROVED"
},
"campaign": "urn:li:sponsoredCampaign:179783044",
"reference!": {
"message": "Unsupported URN domain: li:adInMailContent",
"status": 501
},
"id": 136236994,
"status": "ACTIVE"
}
From the response, you may also notice that we are also getting this warning
"message": "Unsupported URN domain: li:adInMailContent",
"status": 501
We've tried different API requests variations, including specifying different creatives that are active, but to no avail. Also, we were not able to find any info regarding the error above, so we are uncertain what might be causing it.
Thanks!

Q: Linkedin Vector Assest API, Registering Multi-Part Upload - No metadata value in response

I'm attempting to complete a multipart upload using Linkedin V2 Vector Assets and i've noticed that when registering the upload, the metadata field comes back blank in the response.
Here's the request to register the upload https://api.linkedin.com/v2/assets?action=registerUpload
{
"registerUploadRequest":{
"owner":"urn:li:organization:71736744",
"recipes":["urn:li:digitalmediaRecipe:feedshare-video"],
"serviceRelationships":[
{"identifier":"urn:li:userGeneratedContent","relationshipType":"OWNER"}
],
"supportedUploadMechanism":["MULTIPART_UPLOAD"],
"fileSize":50866165
}
and here is the response (removed all but one partUploadRequests object to make the response easier to read)
{
"value": {
"uploadMechanism": {
"com.linkedin.digitalmedia.uploading.MultipartUpload": {
"partUploadRequests": [
{
"headers": {
"Content-Type": "application/octet-stream"
},
"byteRange": { "lastByte": 4194303, "firstByte": 0 },
"url": "https://www.linkedin.com/dms-uploads/C5605AQFnYcNsf7K5Yw/uploadedVideo?sau=aHR0cHM6Ly93d3cubGlua2VkaW4uY29tL2FtYnJ5L2FtYnJ5LXZpZGVvLz94LWxpLWFtYnJ5LWVwPUFRRmp4SlBwRndkUUNnQUFBWGhjYkgwNzNuZmpacTRFM3AxUkpidTMxTlAxems3WmdoUHN1Ymp1TjVGTXVDRGFOaGczVnpHWXNpLW5OYWh2NlkxWkU5UDVIdktsQ2JxbGhhOUt1SElJSnBXTjI0TkEyWDIzM1ZiaS1aNW4yTmlXWWQyX1VlN1J2d0FEdkMwSG51ckNMY1ljMkdrczhKclFlZHRYNlZNN2dvTFJad2hpT0pxcFNZM29mXzdTTmRhZjZzQlNMS3FwaTJyWF9LYTRqTk9OcnBhTFpCam1KR3ZENEV3ZFd0VHEzNm44aEFQbDhCMmc3cVpOd3Q0Ny1TT1ZvcHRoT0dWcTB0cHAxU2VkbkY2aVNVQ3J6RVlwVHdzNDZTQlViME5HbGxITHo4a1ZN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xAvwH5FI1",
"urlExpiresAt": 1616544717116
} ...
],
"metadata": ""
}
},
"asset": "urn:li:digitalmediaAsset:C5605AQFnYcNsf7K5Yw",
"mediaArtifact": "urn:li:digitalmediaMediaArtifact:(urn:li:digitalmediaAsset:C5605AQFnYcNsf7K5Yw,urn:li:digitalmediaMediaArtifactClass:uploadedVideo)"
}
}
The api documentation explains that I need to use the metadata value from the register upload response to complete the upload
I attempt making the request anyway without a value for the metadata field to https://api.linkedin.com/v2/assets?action=completeMultiPartUpload (removed all but one partUploadResponses object to make the response easier to read)
{
"completeMultipartUploadRequest": {
"mediaArtifact": "urn:li:digitalmediaMediaArtifact:(urn:li:digitalmediaAsset:C5605AQFnYcNsf7K5Yw,urn:li:digitalmediaMediaArtifactClass:uploadedVideo)",
"metadata": "",
"partUploadResponses": [
{
"headers": {
"ETag": "/ambry-video/signedId/AQGpSasdC3ezCgAAAXhcbTobXlB6_ujllr8BPUUAX4o9OgbHCxiRKoG9woM85dnGrxbUbd-5IXyMKO7syqyZXLgHFd8GQJkiMvvp1eHI9N32iJqMG-l_aFgSeXMbcqkFFcjuT22djM93dmKs_RBb58kppS3CadOPHSt5_tApCxAq0wgTfYQng3OkV_uVRdjIYftyfnHW3nF2vWz4hZBoX-YhmF6gDhXtN9dNTnU4QpHB7sGCecpjYgT8ypV-u5isvFrujHl3tl4.bin"
},
"httpStatusCode": 200
} ....
]
}
}
This comes back as a 200OK without any response body which is expected.
After that I check the upload status and which comes back with a code of SERVER_ERROR and I'm not able to create a post with the asset id of the uploaded asset.
Response from checking asset status https://api.linkedin.com/v2/assets/C5605AQFnYcNsf7K5Yw
{
"recipes": [
{
"recipe": "urn:li:digitalmediaRecipe:feedshare-video",
"status": "SERVER_ERROR"
}
],
"serviceRelationships": [
{
"relationshipType": "OWNER",
"identifier": "urn:li:userGeneratedContent"
}
],
"mediaTypeFamily": "VIDEO",
"created": 1616458317042,
"id": "C5605AQFnYcNsf7K5Yw",
"lastModified": 1616458454711,
"status": "ALLOWED"
}
Request to create a UGC post with the asset https://api.linkedin.com/v2/assets
{
"author": "urn:li:organization:71736744",
"lifecycleState": "PUBLISHED",
"specificContent": {
"com.linkedin.ugc.ShareContent": {
"media": [
{
"media": "urn:li:digitalmediaAsset:C5605AQFnYcNsf7K5Yw",
"status": "READY",
"title": {
"attributes": [],
"text": "Sample Video Create"
}
}
],
"shareCommentary": {
"attributes": [],
"text": "Some share text"
},
"shareMediaCategory": "VIDEO"
}
},
"visibility": {
"com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC"
}
Response to the request
{
"serviceErrorCode": 0,
"message": "Resource assets does not exist",
"status": 404}
The only thing I can think of is since I don't have a metadata value when completing the upload I'm not able to use the video asset in UGC posts. Anyone encountered a problem similar to this?
Further Investigations
On further investigation the example from the API docs doesn't return a metadata field either. So this is what I think might be happening
I'm not uploading the file chunks correctly and the metadata field isn't required for completing the upload.
The API has a bug in it which prevents it from returning the metadata field when registering a multipart upload.
Figured it out, when using the slice method to break your file up into chunks it needs to be file.slice(firstByte, lastByte + 1)
It also seems that the metadata value from the register upload request isn't need to complete the upload.

JAGQL - Why do I need an id for a post call?

I'm using JAGQL to build a JSON API compatible express server. My database behind it is MongoDB (jsonapi-store-mongodb). I posted my question here as well: https://github.com/holidayextras/jsonapi-store-mongodb/issues/59
According to the JAGQL documentation, https://jagql.github.io/pages/project_setup/resources.html#generateid,
I am told that
generateId
By default, the server autogenerates a UUID for resources which are created without specifying an ID. To disable this behavior (for example, if the database generates an ID by auto-incrementing), set generateId to false. If the resource's ID is not a UUID, it is also necessary to specify an id attribute with the correct type. See /examples/resorces/autoincrement.js for an example of such a resource.
But when I send a POST request to one of my resources, I get this:
"jsonapi": {
"version": "1.0"
},
"meta": {},
"links": {
"self": "/myresource"
},
"errors": [
{
"status": "403",
"code": "EFORBIDDEN",
"title": "Param validation failed",
"detail": [
{
"message": "\"id\" is required",
"path": [
"id"
],
"type": "any.required",
"context": {
"key": "id",
"label": "id"
}
}
]
}
]
What am I missing?
See here for more details: https://github.com/jagql/framework/issues/106
In your resource definition, you want to add primaryKey: 'uuid':
{
resource: 'things',
handlers,
primaryKey: 'uuid',
attributes: {
...
}
}

Bad request: Attempting to associate a ugc with an asset that's not owned by the author

I'm trying to migrate my app from LinkedIn API v1 to v2. I'm currently looking at sharing images (natively) to my personal LinkedIn profile.
I'm following the official docs here: https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/share-on-linkedin#create-an-image-share
To register the image I made the following POST request: to https://api.linkedin.com/v2/assets?action=registerUpload
{
"registerUploadRequest": {
"recipes": [
"urn:li:digitalmediaRecipe:feedshare-image"
],
"owner": "urn:li:person:9PyfTxBTFY",
"serviceRelationships": [
{
"relationshipType": "OWNER",
"identifier": "urn:li:userGeneratedContent"
}
]
}
}
I got the success response:
{
"value": {
"uploadMechanism": {
"com.linkedin.digitalmedia.uploading.MediaUploadHttpRequest": {
"headers": {},
"uploadUrl": "https://api.linkedin.com/mediaUpload/C4D22AQEGOHxBzKUXvw/feedshare-uploadedImage/0?ca=vector_feedshare&cn=uploads&m=AQLhYJm0KOaTCgAAAWhSDplI-Lzlfh7lOsd8D5qBcz0aJ2bf1fwIfnh8ow&app=5212106&sync=0&v=beta&ut=0rKn179ebIA8A1"
}
},
"mediaArtifact": "urn:li:digitalmediaMediaArtifact:(urn:li:digitalmediaAsset:C4D22AQEGOHxBzKUXvw,urn:li:digitalmediaMediaArtifactClass:feedshare-uploadedImage)",
"asset": "urn:li:digitalmediaAsset:C4D22AQEGOHxBzKUXvw"
}
}
I successfully uploaded an image as binary using the returned uploadUrl:
curl -i --upload-file PATH_TO_FILE --header "Authorization: Bearer TOKEN" 'https://api.linkedin.com/mediaUpload/C4D22AQEGOHxBzKUXvw/feedshare-uploadedImage/0?ca=vector_feedshare&cn=uploads&m=AQLhYJm0KOaTCgAAAWhSDplI-Lzlfh7lOsd8D5qBcz0aJ2bf1fwIfnh8ow&app=5212106&sync=0&v=beta&ut=0rKn179ebIA8A1'
To confirm that the image is ready for use, I checked the status of the asset with the GET https://api.linkedin.com/v2/assets/C4D22AQEGOHxBzKUXvw which returned
{
"serviceRelationships": [
{
"identifier": "urn:li:userGeneratedContent",
"relationshipType": "OWNER"
}
],
"recipes": [
{
"recipe": "urn:li:digitalmediaRecipe:feedshare-image",
"status": "AVAILABLE"
}
],
"mediaTypeFamily": "STILLIMAGE",
"created": 1547564914979,
"lastModified": 1547564994321,
"id": "C4D22AQEGOHxBzKUXvw",
"status": "ALLOWED"
}
Based on the docs, I can now simply reference the asset URN in the UGC post.
This is the test image post I'm trying to share using the https://api.linkedin.com/v2/ugcPosts endpoint
{
"author": "urn:li:person:9PyfTxBTFY",
"lifecycleState": "PUBLISHED",
"specificContent": {
"com.linkedin.ugc.ShareContent": {
"shareCommentary": {
"text": "Testing LinkedIn image shares"
},
"shareMediaCategory": "IMAGE",
"media": [
{
"status": "READY",
"description": {
"text": "Some text"
},
"media": "urn:li:digitalmediaAsset:C4D22AQEGOHxBzKUXvw",
"title": {
"text": "Some title"
}
}
]
}
},
"visibility": {
"com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC"
}
}
But I keep getting the error:
{
"message": "Attempting to associate a ugc with an asset that's not owned by the author",
"status": 400
}
The above request works perfectly when trying to share a status update or a link attachment.
I haven't tried it with videos yet (similar approach) since I assume I will face the same problem. I haven't tried sharing as an organization either since I need to be accepted to the LinkedIn Marketing Developer Program first.
I can confirm that this has been fixed by the LinkedIn Developer Team. Follow the same steps as above and it should work perfectly, as long as the authenticated user has granted the w_member_social permission.
On the last request I now get 201 Created response with the header X-RestLi-Id containing the link to the new post urn:li:share:6494126499975700480.
https://www.linkedin.com/feed/update/urn:li:share:6494126499975700480
P.S. If you're re-trying an old request / registered upload, it won't work, so make sure you try it with a new asset. I believe the bug was when registering uploads.

Sabre Hotel Content Rest API stopped working

POSTing to https://api.sabre.com/v1.0.0/shop/hotels/content?mode=content yesterday worked fine, but with the same Postman request is failing today.
The fault code is: "Client.InvalidCustomerAppId" (but the Http status code is 200.)
Nothing changed on our end, is it possible that I was using an account that no longer has access to this API?
Full JSON response is:
{
"Fault": {
"faultcode": "{http://schemas.xmlsoap.org/soap/envelope/}Client.InvalidCustomerAppId",
"faultstring": "Field CustomerAppId is invalid",
"detail": {
"StackTrace": [
"com.sabre.universalservices.base.exception.ApplicationException: errors.xml.USG_INVALID_CUSTOMER_APP_ID"
]
}
},
"Links": [
{
"rel": "self",
"href": "https://api.sabre.com/v1.0.0/shop/hotels/content?mode=content"
},
{
"rel": "linkTemplate",
"href": "https://api.sabre.com/<version>/shop/hotels/content?mode=<mode>"
}
]
}

Resources