We are using Linkedin v1 api update-comments-as-company endpoint to post comments on behalf of company page managed by the user. Nowadays this endpoint throws 500 error response while trying to add comment.
Example request:
curl -X POST -H "Authorization: Bearer xxxx" -H "Content-Type: application/json" -H "x-li-format: json" 'https://api.linkedin.com/v1/companies/12345/updates/key=UPDATE-c12345-640455667889990765/update-comments-as-company' --data '{"comment": "Posting as a company!"}'
Response:
{
"errorCode": 0,
"message": "Internal service error",
"requestId": "OBVNKWRJDC",
"status": 500,
"timestamp": 1528183732917
}
Kindly help me to resolve this.
Related
I'm trying to get the access token on Postman. I'm in "Get acces token", "body" and I'm using the 'POST' method (not the 'GET' one). When I click on the "send" button, I read this message:
{
"timestamp": "2022-11-07T21:26:28.119+00:00",
"status": 401,
"error": "Unauthorized",
"message": "",
"path": "/oidc/accessToken"
}
I think the problem is my oauth2 url. I didn't understand how to get one. I read on the internet that the url should be like this:
https://id:secret#mywebsite.com
Is it correct? I doesn't work for me.
How could I write a correct oauth2 url?
Thank you in advance!
PS: the 'code snippet' is this one:
curl --location --request POST 'https://link/accessToken' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'APIM-Debug: true' \
--data-urlencode 'client_id=' \
--data-urlencode 'client_secret=' \
--data-urlencode 'username=myusername' \
--data-urlencode 'password=mypassword' \
--data-urlencode 'grant_type=client_credentials'
I am trying to add Azure B2C as on OIDC provider for Firebase Auth. The implicit flow works fine but the code flow fails with either of the following errors :
Malformed response cannot be parsed from oidc.<provider_name> for CODE_EXCHANGE
or
Invalid OAuth response from oidc.<provider_name>
On investigation I found that the last call where this failure happens is this :
curl --location --request POST 'https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyAssertion?key=<web_key>' \
--header 'Content-Type: text/plain' \
--data-raw '{
"returnSecureToken" : true,
"requestUri" : "https://<firebase_project_name>.firebaseapp.com/__/auth/handler?state=<state_goes_here>&code=<authcode_flow_code>",
"postBody" : "providerId=oidc.<provider_name>",
"sessionId" : "<random_session_id>",
"autoCreate" : true,
"returnIdpCredential" : true
}'
Response for this request comes as :
{
"error": {
"code": 400,
"message": "INVALID_IDP_RESPONSE : Invalid OAuth response from oidc.<provider_name>",
"errors": [
{
"message": "INVALID_IDP_RESPONSE : Invalid OAuth response from oidc.<provider_name>",
"domain": "global",
"reason": "invalid"
}
]
}
}
I tried checking Firebase logs but no helpful information available. However, I did noticed that Firebase exchanged this code for the id_token successfully from Azure B2C before failing and returning 400 error.
Any help in this regard?
I am trying to complete a checkout with the /checkout API integrated with Stripe, following this documentation: https://shopify.dev/tutorials/complete-a-sales-channel-payment-with-checkout-api#integrate-stripe-wi...
I am getting this response on my final request:
Request:
curl --location --request POST 'https://<nameofmyshop>.myshopify.com/admin/api/2021-04/checkouts/<shopify-checkout-token>/complete.json' \
--header 'Content-Type: application/json' \
--header 'X-Shopify-Access-Token: <shpat_shopify-access-token>' \
--data-raw '{
"payment": {
"amount": "1.00",
"unique_token": "unique token I made",
"payment_token": {
"payment_data": "<tok_stripe-vault-token>",
"type": "stripe_vault_token"
},
"request_details": {
"ip_address": "123.1.1.1",
"accept_language": "en",
"user_agent": "Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/54.0.2840.98 Safari\/537.36"
}
}
}'
(error) Response:
422 Unprocessable Entity
{
"errors": {
"base": [
{
"code": "missing_transactions",
"message": "Cannot complete the checkout without any transactions.",
"options": {}
}
]
}
}
Some details about my Shopify Shop, and Stripe setup:
I have Shopify Payments enabled
test mode is on
I successfully placed an order though the shop's website with CC# 4242 4242 4242 4242
I have a test Stripe Connect account for my "customer"
I can successfully get a Stripe token generated for the customer
Here is my flow:
create a checkout POST https://{{store_name}}.myshopify.com/admin/api/{{api_version}}/checkouts.json
Save checkout.token, and checkout.shopify_payments_account_id from the response
Get Stripe token for customer:
curl --location --request POST 'https://api.stripe.com/v1/tokens' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Stripe-Account: {{shopify_payments_account_id}}' \
--header 'Authorization: Bearer {{stripe-token}}' \
--data-urlencode 'customer=<cus_customers-stripe-connect-id>'
save id from response "id: <tok_stripe-vault-token>"
complete checkout with Stripe token (request above)
Should we be able to complete a checkout using Shopify /checkout API + Stripe-Connect Test Accounts?
Thank you for any help!
I was using the wrong endpoint:
final request should go to /payments.json, not /complete.json
url --location --request POST 'https://<nameofmyshop>.myshopify.com/admin/api/2021-04/checkouts/<shopify-checkout-token>/payments.json' \
--header 'Content-Type: application/json' \
--header 'X-Shopify-Access-Token: <shpat_shopify-access-token>' \
--data-raw '{
"payment": {
"amount": "1.00",
"unique_token": "unique token I made",
"payment_token": {
"payment_data": "<tok_stripe-vault-token>",
"type": "stripe_vault_token"
},
"request_details": {
"ip_address": "123.1.1.1",
"accept_language": "en",
"user_agent": "Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/54.0.2840.98 Safari\/537.36"
}
}
}'
I make a request to Google shopping by curl:
curl --request POST \
'https://shoppingcontent.googleapis.com/content/v2.1/products/batch?key=[YOUR_API_KEY]' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"entries":[]}' \
--compressed
and the response is
{
"error": {
"code": 403,
"message": "Request had insufficient authentication scopes.",
"errors": [
{
"message": "Insufficient Permission",
"domain": "global",
"reason": "insufficientPermissions"
}
],
"status": "PERMISSION_DENIED"
}
}
I'm sure my access_token is right, but I'm not sure if my API_KEY is right.
My API_KEY is gotten in https://console.cloud.google.com/apis/credentials , and the API_KEY's restrictions is none.
And my Content API for Shopping is enabled:
I wonder if I miss any critical method, that I can't request the api successfully.
By the way, how can I get my merchant_id? Is it my merchant_id?
But the method "Verify and claim your website URL in Business information", I didn't pass. Does it cause to the 403 error?
Trying to pull financial reports from apple connect api and getting a 403 for CREATE operation, this is not documented :/. anyone know how I use a GET_COLLECTIONS operations here with cURL?
exec("curl -v -X POST -H 'Authorization: Bearer {$token}' \"https://api.appstoreconnect.apple.com/v1/financeReports\" -d 'regionCode=Americas&reportDate=2020-01&reportType=FINANCIAL&vendorNumber=xxx&' -o output");
Response:
{
"errors" : [ {
"id" : "bb9e260c-c3d4-4df9-b78e-f34dfd42c449",
"status" : "403",
"code" : "FORBIDDEN_ERROR",
"title" : "The given operation is not allowed",
"detail" : "The resource 'financeReports' does not allow 'CREATE'. Allowed operations are: GET_COLLECTION"
} ]
}
response
You need to use GET, Not POST
exec("curl -v X GET -H 'Authorization: Bearer {$token}' \"https://api.appstoreconnect.apple.com/v1/financeReports?regionCode=Americas&reportDate=2020-01&reportType=FINANCIAL&vendorNumber=xxx\" -o output");
should do the trick!