Keep getting "There was a problem with the request" when using hubspot search api - hubspot

I am doing a search on contacts and I keep getting a response of
{
"status": "error",
"message": "There was a problem with the request.",
"correlationId": "32073a19-9272-4955-a756-e3b6a4671738"
}
the correlation id keeps changing.
This type of error response does not help determine what is going wrong.
I am just making a simply search reguest
curl --location --request POST 'https://api.hubapi.com/crm/v3/objects/contacts/search?hapikey=MY_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"filterGroups": [
{
"filters": [
{
"value": "Spam (Auto Deletes Contact)",
"propertyName": "Contact Type",
"operator": "EQ"
}
]
}
],
"limit": 10,
"after": 0
}'
Where can I go to get some help?

The problem was the name of the property I was trying to find.
'Contact Type' (as shown on the HubSpot website) is actually 'contact_type' when being used in an API call.
**IF the error message had said something like 'Unknown Property' this would have helped diagnose my error **

Related

fulfillment shopify api not working 2023-01

I am trying to use this api /fulfillments.json in shopify but i am getting error {"errors":"Not Found"}
my code is here
curl --location --request POST 'https://logixgrid-save.myshopify.com/admin/api/2023-01/fulfillments.json' \
--header 'X-Shopify-Access-Token: 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' \
--header 'Content-Type: application/json' \
--data-raw '{
"fulfillment": {
"message": "The package was shipped this morning.",
"notify_customer": false,
"tracking_info": {
"number": 1562678,
"url": "https://www.my-shipping-company.com",
"company": "my-shipping-company"
},
"line_items_by_fulfillment_order": [
{
"fulfillment_order_id": 5247929286964,
"fulfillment_order_line_items": [
{
"id": 1058737495,
"quantity": 1
}
]
}
]
}
}'
Here is my test store detail you can try this i will delete all these after 2 days
i am getting this response
{"errors":"Not Found"}
Most likely this is because 1058737495 id was took directly from documentation and you don't have such line_item in your order.
EDIT: Your fulfillment order id is wrong. You can get correct one by fetching /admin/api/2023-01/orders/{{ order.id}}/fulfillment_orders.json. This will return array of fulfillment orders. Try one of the ids - it should be working.
curl -X GET "https://redacted.myshopify.com/admin/api/2023-01/orders/5250054553908/fulfillment_orders.json" \
-H "X-Shopify-Access-Token: shpca_redacted"

How to setup Adyen acquirer account

I have a problem with testing MB WAY for API only payment method on Adyen https://docs.adyen.com/payment-methods/mb-way/api-only
After I send request as described here https://docs.adyen.com/payment-methods/mb-way/api-only#make-payment
curl https://checkout-test.adyen.com/v68/payments \
-H 'x-api-key: YOUR_API_KEY' \
-H 'content-type: application/json' \
-d '{
"merchantAccount": "YourCompanyECOM",
"reference": "My first Adyen test payment",
"amount": {
"value": 1000,
"currency": "EUR"
},
"paymentMethod": {
"type": "scheme",
"encryptedCardNumber": "test_4111111111111111",
"encryptedExpiryMonth": "test_03",
"encryptedExpiryYear": "test_2030",
"encryptedSecurityCode": "test_737"
}
}'
I receive this response
{
"status": 500,
"errorCode": "905_1",
"message": "Could not find an acquirer account for the provided txvariant (mbway), currency (EUR), and action (AUTH).",
"errorType": "configuration",
"pspReference": "GBSGRNJVSBLZNN82"
}
I did not found a way to set up an acquirer account on Adyen dashboard so far. Is that option there, or I need to do something else to make it work?
This kind of error can have as origin one of the following reasons:
The currency is not configured or supported
The minimum amount is set too low
The payment method is not configured on your account
The payment type (shopperInteraction) is not supported.
The full documentation of this error is here

Cannot create new Pipeline using Az DevOps Pipelines API 6.0-preview.1

I'm trying to create new Pipelines using this API endpoint:
POST https://dev.azure.com/{organization}/{project}/_apis/pipelines?api-version=6.0-preview.1
This is the request I'm using:
curl -X POST \
'https://dev.azure.com/<myorg>/<myproj>/_apis/pipelines?api-version=6.0-preview.1' \
-H 'Authorization: Basic <b64string>' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{
"configuration":{
"repository": {
"id": "<repo-guid>",
"name": "<repo-name>",
"type": "azureReposGit"
},
"path": "pipeline.yaml",
"type": "yaml"
},
"folder": "\\custompath\\",
"name": "<pipelinename>"
}
I keep getting the same error:
{
"$id": "1",
"innerException": null,
"message": "Value cannot be null.\r\nParameter name: repositoryName",
"typeName": "System.ArgumentNullException, mscorlib",
"typeKey": "ArgumentNullException",
"errorCode": 0,
"eventId": 0
}
It seems an issue with my payload, but documentation isn't very helpful about it
https://learn.microsoft.com/en-us/rest/api/azure/devops/pipelines/pipelines/create?view=azure-devops-rest-6.0
Current version o nodejs sdk doesn't support the Pipeline API yet. Can anyone help me?
I'm able to reproduce your issue on my side, and have reported this issue at website below:
https://developercommunity.visualstudio.com/content/problem/1101376/create-pipeline-rest-api-does-not-work.html
Product team has provided response that "A fix for this issue has been prepared. It should be released to everyone within the next 3 weeks."

Check whether a test case already exists before creating it - TFS 2018

I am creating a test case in TFS 2018 using postman like this:
curl -X POST \
'https://TFSURL:443/DefaultCollection/PROJECT/_apis/wit/workitems/$Test%20Case?api-version=4.1' \
-H 'Authorization: Basic MYKEY' \
-H 'Content-Type: application/json-patch+json' \
-d '[
{
"op": "add",
"path": "/fields/System.AreaPath",
"from": null,
"value": "TEST\\Automation"
},
{
"op": "add",
"path": "/fields/System.IterationPath",
"from": null,
"value": "TEST\\Sprint 8"
},
{
"op": "add",
"path": "/fields/System.Title",
"from": null,
"value": "Sample task"
},
{
"op": "add",
"path": "/fields/Microsoft.VSTS.TCM.Steps",
"value": "<steps id=\"0\">
<step id=\"1\" type=\"ValidateStep\"><parameterizedString isformatted=\"true\">Input step 1</parameterizedString><parameterizedString isformatted=\"true\">Expectation step 1</parameterizedString><description/></step>
<step id=\"2\" type=\"ValidateStep\"><parameterizedString isformatted=\"true\">Input step 2</parameterizedString><parameterizedString isformatted=\"true\">Expectation step 2</parameterizedString><description/></step>
<step id=\"3\" type=\"ValidateStep\"><parameterizedString isformatted=\"true\">Input step 3</parameterizedString><parameterizedString isformatted=\"true\">Expectation step 3</parameterizedString><description/></step>
<step id=\"4\" type=\"ValidateStep\"><parameterizedString isformatted=\"true\">Input step 4</parameterizedString><parameterizedString isformatted=\"true\">Expectation step 4</parameterizedString><description/></step></steps>"
}
]'
How can I check before sending this request that this test exist so that I can update it instead of creating a new one every time?
I was expecting to do it by :
searching the name of the automation which should be unique in tfs (method name from automation script) and see if it returns something
It seems like in tfs there is a way to do a request to get all work items but I am not sure if you can return based on the title field of the item. (Help page on how to do this request)
I tried to use the search api to return the results if anything with that name exists in tfs but I am getting an error message which I don't know how to resolve
curl -X POST \
'https://TFSURL:443/DefaultCollection/PROJECT/_apis/search/workitemsearchresults?api-version=4.1-preview' \
-H 'Authorization: Basic MYKEY' \
-H 'Content-Type: application/json' \
-d '[
{
"searchText": "Sample task",
"$skip": 0,
"$top": 1,
"filters": {
"System.AreaPath": [
"TEST\\Automation"
]
},
"$orderBy": [
{
"field": "system.id",
"sortOrder": "ASC"
}
],
"includeFacets": true
}
]'
'
Response:
{
"count": 1,
"value": {
"Message": "An error has occurred."
}
}
Just to answer my own question in case someone else needs it, as I have read you can't do this with just a single or two different API calls. for the following solution i have created multiple REST API request to TFS and called/processed them with Python >3.
What I have done in order to update a test case if it exist or create a new one it if it is not:
Create in tfs a query which returns all test cases
Update query using an API request and the key of the query you have created (i specified iteration and team specifically in the body of the request) (help)
Create an API request to get the result of that query (help)
In a loop i was iterating over all the test case ids the query has returned
In the same loop I have used the test case id to access with a request that specific work item (help)
I then compared the title of the returned item versus the title that i want to create from my automate script (ClassName_MethodName)
If those titles where the same I do a request to update that test case using the test id i got and then break from the loop
If the titles were different i create a new test case and then break from the loop
I know this is not the fastest solution but at least it is working!
If there is another way which is easier and faster I am more than happy to follow it.

check status of job requested through travis API v3

So I've submitted a request using travis api v3 guide and got response like:
{
"#type": "pending",
"remaining_requests": 10,
"repository": {
"#type": "repository",
"#href": "/repo/111111111",
"#representation": "minimal",
"id": 111111111,
"name": "my-111111111",
"slug": "me/my111111111"
},
"request": {
"repository": {
"id": 222222,
"owner_name": "me",
"name": "my-111111111"
},
"user": {
"id": 333333
},
"id": 444444,
"message": "Cool message",
"branch": "master"
},
"resource_type": "request"
}
So what is the way to get status of those jobs now? I suppose that I need to use id 444444, but I am getting error below, not sure what I am doing wrong:
curl -s -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Travis-API-Version: 3" \
-H "Authorization: token mycooltoken" \
https://api.travis-ci.org/repo/111111111/requests/444444
{
"#type": "error",
"error_type": "not_found",
"error_message": "resource not found (or insufficient access)"
}
Can somebody point me where to look for examples or any other idea?
Oh sorry for confusion - somehow I overlooked that I must change POST to GET; with that simple fix everything worked fine.