I am trying to create a checkout via Shopify admin rest API and in response, I am getting a validation error which looks like this.
{
"errors": {
"line_items": {
"0": {
"variant_id": [
{
"code": "invalid",
"message": "is invalid",
"options": {}
}
]
}
}
}
}
Request[POST]:
URL: https://mystore.myshopify.com/admin/checkouts.json
{
"checkout": {
"line_items": [
{
"variant_id": "15465470460017",
"quantity": 1
}
]
}
}
I verified the varient_id by looking into the cart JSON on the link "https://mystore.myshopify.com/cart.json".
I also followed the documentation given on Shopify. If I create empty checkout without varient_id then it works otherwise it returns the invalid variant id error.
I tried this request on PostMan. For updated and others it is working fine but for checkout create I couldn't find the point where I am going wrong.
Related
I have created a simple intent in DialogFlow where the user asks 'how old someone is' (ex. "How old is David Beckham?").
This is then sent to a cloud run web hook that returns a response: "How am I meant to know?".
When i test this in the DialogFlow console it works fine and the JSON response is returned from Cloud Run to Dialogflow:
FULFILLMENT RESPONSE
{
"payload": {
"google": {
"expectUserResponse": true,
"richResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": "How am I meant to know?!"
}
}
]
}
}
}
The problem is that DialogFlow is not responding with "How am I meant to know?" in the console. its not responding with anything.
Is there something else i need to do for this to happen? I assumed this would happen automatically.
That response is only for Google Assistant, you need to add a "default" response in this format:
{
"fulfillmentMessages": [
{
"text": {
"text": [
"Text response from webhook"
]
}
}
]
}
Every integration has a different format response but they could be used together
Check the docs:
https://cloud.google.com/dialogflow/docs/fulfillment-webhook
We are integrating payments in our application using Adyen Web Drop-in plugin, as we are not PCI compliant we are receiving encrypted info from Drop-in Like below :
{
"data": {
"paymentMethod": {
"type": "scheme",
"encryptedCardNumber" : "adyenjs_0_1_25$...",
"encryptedExpiryMonth" : "adyenjs_0_1_25$..."
"encryptedExpiryYear" : "adyenjs_0_1_25$..."
"encryptedSecurityCode" : "adyenjs_0_1_25$..."
}
},
"isValid": true
}
We need to call /authorize API and it needs encrypted data in a single property card.encrypted.json like follow :
{
"reference":"YourPaymentReference",
"merchantAccount":"TestMerchant",
"amount":{
"currency":"EUR",
"value":1500
},
"additionalData":{
"authorisationType":"PreAuth",
"card.encrypted.json : "adyenjs_0_1_25$..*"
}
}
So far we have tried to pass whole JSON provided by Drop-in in the field, but it doesn't work and we get the following response from Adyen.
{
"status": 422,
"errorCode": "174",
"message": "Unable to decrypt data",
"errorType": "validation"
}
So does anyone know how to convert our data into that card.encrypted.json, I've seen that there are other Adyen plugins that generate this token using custom forms, but we need to use Drop-in Plugin and its not generating this field.
Thanks.
With the drop-in and other components, you need to use the /payments API.
Your /authorise examples requires minimal changes to become a /payments request. You need to pass along the paymentMethod object directly to the /payments request:
{
"reference":"YourPaymentReference",
"merchantAccount":"TestMerchant",
"amount":{
"currency":"EUR",
"value":1500
},
"paymentMethod": {
"type": "scheme",
"encryptedCardNumber" : "adyenjs_0_1_25$...",
"encryptedExpiryMonth" : "adyenjs_0_1_25$..."
"encryptedExpiryYear" : "adyenjs_0_1_25$..."
"encryptedSecurityCode" : "adyenjs_0_1_25$..."
},
"additionalData":{
"authorisationType":"PreAuth",
}
}
i'm using the Foursquare API in a project in order to manage venues informations through my app. Everything works fine, until I try to POST data to edit a venue details.
Actually, the post request seems to work fine, since a I get a 200 status code response. However I never see my changes on the platform. Here's the response I get :
{
"meta": {
"code": 200,
"requestId": "5d0a1b210d2be70039f03fc4"
},
"notifications": [
{
"type": "notificationTray",
"item": {
"unreadCount": 0
}
}
],
"response": {
"woes": []
}
}
Did any one succesfully used Foursquare API to edit venue details and then saw the changes on the platform ?
Thanks for your help !
I am using Azure AD B2C to create users.
After a user is created I would like to add them to a Group
Using Postman I have made the following request (with access token in the header). Note: I have managed to successfully create a group using the Api.
POST
https://graph.windows.net/{azure-tenant}/groups/{group-objectId/members/$ref?api-version=1.6
With Body:
{
"#odata.id": "https://graph.windows.net/{azure-tenant}/directoryObjects/{user-objectId}"
}
Which is what the documentation specifies. No matter the body that is sent I get the following error
{
"odata.error": {
"code": "Request_BadRequest",
"message": {
"lang": "en",
"value": "The request URI is not valid. Since the segment 'members' refers to a collection, this must be the last segment in the request URI. All intermediate segments must refer to a single resource."
},
"requestId": "48cf65f3-20ba-411e-8121-f7ea54252f3a",
"date": "2019-05-27T06:09:25"
}
}
I tried removing the /$ref
POST
https://graph.windows.net/{azure-tenant}/groups/{group-objectId/members?api-version=1.6
Body:
{
"#odata.id": "https://graph.windows.net/{azure-tenant}/directoryObjects/{user-objectId}"
}
as well as
{
"#odata.id": "https://graph.windows.net/{azure-tenant}/users/{user-objectId}"
}
Now the error that gets returned now is:
{
"odata.error": {
"code": "Request_BadRequest",
"message": {
"lang": "en",
"value": "Unsupported resource type 'DirectoryObject' for operation 'Create'."
},
"requestId": "2c36cc6d-383c-44f8-8609-2ac3e3efc862",
"date": "2019-05-27T06:15:26"
}
}
The documentation that I have been using https://learn.microsoft.com/en-us/graph/api/group-post-members?view=graph-rest-1.0&tabs=javascript
You are using graph.windows.net endpoint, so you should refer to azure ad graph api.
POST https://graph.windows.net/myorganization/groups/b4bda672-1fba-4711-8fb1-5383c40b2c14/$links/members?api-version=1.6
{
"url": "https://graph.windows.net/myorganization/directoryObjects/3eb6055a-baeb-44d4-a1ea-2fee86d8891b"
}
The document you referred to is microsoft graph api. The endpoint should be https://graph.microsoft.com.
You can use Microsoft Graph explorer to call these apis.
{
members {
id
lastName
}
}
When I tried to get the data from members table, I can get the following responses.
{ "data": {
"members": [
{
"id": "TWVtYmVyOjE=",
"lastName": "temp"
},
{
"id": "TWVtYmVyOjI=",
"lastName": "temp2"
}
] } }
However, when I tried to update the row with 'id' where clause, the console shows error.
mutation {
updateMembers(
input: {
values: {
email: "testing#test.com"
},
where: {
id: 3
}
}
) {
affectedCount
clientMutationId
}
}
"message": "Unknown column 'NaN' in 'where clause'",
Some results from above confused me.
Why the id returned is not a numeric value? From the db, it is a number.
When I updated the record, can I use numeric id value in where clause?
I am using nodejs, apollo-client and graphql-sequelize-crud
TL;DR: check out my possibly not relay compatible PR here https://github.com/Glavin001/graphql-sequelize-crud/pull/30
Basically, the internal source code is calling the fromGlobalId API from relay-graphql, but passed a primitive value in it (e.g. your 3), causing it to return undefined. Hence I just removed the call from the source code and made a pull request.
P.S. This buggy thing which used my 2 hours to solve failed in build, I think this solution may not be consistent enough.
Please try this
mutation {
updateMembers(
input: {
values: {
email: "testing#test.com"
},
where: {
id: "3"
}
}
) {
affectedCount
clientMutationId
}
}