Hi i am trying to add new address using curl API
here-API example link
I used to this blog example but it showing 540 gateway timeout
body:::
[{
"type":"Point",
"coordinates":[-87.63245,41.88425],
"properties": {
"v": "2.7",
"referenceIds" : ["276397653"],
"details": "Update of phone number, URL and e-mail",
"phone": "+1 111 2 333",
"email": "MyPlace#MyPlace.com",
"URL": "www.MyPlace.com",
"error": 31,
"currentValues": {
"phone": "+1 111 2 350"
},
"appId": "hIY6TtmGIDrjdjayDWYn"
}
}]
headers:::
[{"key":"Auth-Service-Id","value":"here_app","description":""},{"key":"Auth-Identifier","value":"hIY6TtmGIDrjdjayDWYn","description":""},{"key":"Auth-Secret","value":"3zKE2v6wpZ51p7Xi4WC2Fg","description":""},{"key":"Content-Type","value":"application/vnd.here.layerObjectList+json; charset=UTF-8","description":""},{"key":"Group-Id","value":"FGx1AWaAzKOo0imNkLmf","description":""},{"key":"Content-Disposition","value":"application/vnd.here.layerObjectList+json; charset=UTF-8","description":""},{"key":"Accept","value":"application/vnd.here.layerObjectList+json","description":""},{"key":"Accept-Charset","value":"charset=UTF-8","description":""}]
Below are the header and body values passed in postman:
Related
I am fairly new to WP programming and not that skill with backend work.
A client recently asked to add an API to the current form they have on their website. We are using the Contact Form 7 plugin for submissions.
Below is the REST API they sent over to add to the form. I am unsure how to place the code to the form.
Any guidance is greatly appreciated.
Web Service Type: REST
Endpoint: https://api.anasight.com/emive
Method: POST
Encoding: application/json
API KEY must be passed in header named ‘x-api-key’
Concurrency limits: 500 requests / sec
Data Model:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "PersonLite",
"type": "object",
"required": [ "email","ip","regdttm","sourceurl","flex1" ],
"properties": {
"email": {
"type": "string",
"description": "The person's email address."
},
"ip": {
"type": "string",
"description": "The person's IP address captured at registration."
},
"regdttm": {
"type": "string",
"description": "The timestamp when the person registered to receive emails."
},
"sourceurl": {
"type": "string",
"description": "The url of the site that collected the registration."
},
"firstname": {
"type": "string",
"description": "The person's first name."
},
"lastname": {
"type": "string",
"description": "The person's last name."
},
"city": {
"type": "string",
"description": "The person's city."
},
"state": {
"type": "string",
"description": "The person's state."
},
"zip": {
"type": "string",
"description": "The person's ZIP code."
},
"listid": {
"type": "string",
"description": "The listid from the publisher."
},
"flex1": {
"type": "string",
"description": "Please send value of E for emive records and M for Myza records"
}
}
}
Sample CURL request:
curl --silent --show-error -H "Accept: application/json" -H "Content-Type: application/json" -H "x-api-key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" --data '{"firstname":"Joe","lastname":"Johnson","email":"joe#example.com","city":"Roswell","state":"NM","zip":"12345-6789","ip":"127.0.0.1","regdttm":"2021-05-11 14:25:00","sourceurl":"sendmegreatoffers.com"}' https://api.anasight.com/emive
I tried to add multiple product at once using WooCommerce API but I can't.
Can any one help me.
I successfully added single product but I can't add multiple. (When we go with single product method for huge volume, it's take long time. that's why)
I tried code posted below.
Reference doc:- https://woocommerce.github.io/woocommerce-rest-api-docs/v3.html?php#create-update-multiple-products
End point URL:- https://example.com/wp-json/wc/v3/products/bulk
Data:-
{
"create": [
{
"title": "Premium Quality22",
"type": "simple",
"regular_price": "77.99",
"description": "This is First product description from Balamurugan Ayyasamy",
"short_description": "This is First product description from Balamurugan Ayyasamy",
"categories": [
9,
14
],
"images": [
{
"src": "http://example.com/wp-content/uploads/2021/12/preview_1000-2009446955-2-547x365.jpg",
"position": 0
},
{
"src": "http://example.com/wp-content/uploads/2021/12/preview_1000-2009446955-2-547x365.jpg",
"position": 1
}
]
},
{
"title": "Premium Quality2",
"type": "simple",
"regular_price": "34.99",
"description": "This is second product description from Balamurugan Ayyasamy",
"short_description": "This is second product description from Balamurugan Ayyasamy",
"categories": [
9,
14
],
"images": [
{
"src": "http://example.com/wp-content/uploads/2021/12/preview_1000-1928542175.jpg",
"position": 0
},
{
"src": "http://dev.datanetiix.com/orange_coast/wp-content/uploads/2021/12/preview_1000-1928542175.jpg",
"position": 1
}
]
}
]
}'
I got this response when tried with postman (When I am tried using PHP curl function same result)
{
"code": "rest_no_route",
"message": "No route was found matching the URL and request method.",
"data": {
"status": 404
}
}
You're using the outdated WooCommerce API reference. Try to use this endpoint instead:
https://woocommerce.github.io/woocommerce-rest-api-docs/#batch-update-products
I have successfully created an Bearer Token and i would like to request data from the Tour Planning/VRP API. However, i always get the following response: { "error": "Forbidden", "error_description": "These credentials do not authorize access" }
If i try to make the request with the APIKey instead of the Bearer Token, I don't get autenthification.
Authorization by token and apikey work fine for me, I have used it at the same time in other methods and it works fine. But none of these two authorization methods works:
POST https://vrp.api.here.com/v1/problems
Authorization: Bearer <My_Token>
or
POST https://vrp.api.here.com/v1/problems?apikey=My_ApiKey
with this Body:
{
"plan": {
"jobs": [
{
"id": "myJob",
"places": {
"delivery": {
"location": {"lat": 52.46642, "lng": 13.28124},
"times": [["2019-07-04T10:00:00.000Z","2019-07-04T12:00:00.000Z"]],
"duration": 180
}
},
"demand": [1]
}
]
},
"fleet": {
"types": [
{
"id": "myVehicle",
"profile": "normal_car",
"costs": {
"distance": 0.0002,
"time": 0.004806,
"fixed": 22
},
"shifts": [{
"start": {
"time": "2019-07-04T09:00:00Z",
"location": {"lat": 52.52568, "lng": 13.45345}
},
"end": {
"time": "2019-07-04T18:00:00Z",
"location": {"lat": 52.52568, "lng": 13.45345}
}
}],
"limits": {
"maxDistance": 300000,
"shiftTime": 28800
},
"capacity": [10],
"amount": 1
}
],
"profiles": [{
"name": "normal_car",
"type": "car",
"departureTime": "2019-07-04T09:15:00Z"
}]
}
}
Thanks Jose
You are probably using your Freemium account, which does not include access to the Tour Planning API at this point. We are working on an update for the developer portal that will make it more clear which APIs are included. If you need access please use the contact us form on the developer portal to reach out to a HERE representative.
I could http post only with Input.Number now, but Input.Date and Input.Text both receive 400 error.
I was planning to create a Microsoft Flow to receive some value from Outlook Adaptive Card Action.Http Post method, I followed some articles from internet show me how to do that, finally I get rid of the 401 error because it needs Authorisation header.
Okay, then I moved on to test http payload. The body couldn't be something like "body": "test", otherwise it will either gives me an 400 or even not shows adaptive card in email at all. After I learned that I have to use they officially suggested {{someId.value}} into "body".
I succeeded for the first time with Input.Number:
{
"type": "Input.Number",
"id": "test1",
"title": "New Input.Toggle",
"value": "",
"validation": null,
"placeholder": "Placeholder text",
"min": "0",
"max": "60"
}
Then outlook tells me it is successful and I did get the endpoint flow run and receive correct payload. And this is the "Action.Http" part:
"actions": [
{
"type": "Action.Http",
"title": "Say hello",
"method": "POST",
"url": "myflowhttptriggerurl",
"body": "{{nameInput.value}}",
"headers": [
{ "name": "Authorization", "value": "" }
]
}
]
Below is what get error:
After then, I tried with Input.Text and Input.Date, they all give me 400, below is payload, and don't worry for Action.Http, I change id each time when testing:
{
"type": "Input.Date",
"id": "h",
"title": "New Input.Toggle",
"value": "",
"validation": null
}
Text payload:
{
"type": "Input.Text",
"id": "newTask",
"isRequired": true,
"placeholder": "Enter a new task"
}
OK, first I would install the "Actionable Messages Debugger" into Microsoft Office to make it easier to understand if the contents of your card is correct.
It appears from the card you are doing it correct, what happening on your flow that is receiving the message?
You could always try send through a JSON object, so your body will be
"body": "{\"comment\":\"{{comment.value}}\"}"
Where comment is the id of your Input.Text as such:
{
"id": "comment",
"type": "Input.Text"
"isMultiline": true,
"placeholder": "Comments"
}
I have set up open TSDB using docker image. I am able to push data to database via HTTP post request.
[{
"metric": "sys.cpu.nice",
"timestamp": 1567764102,
"value": 18,
"tags": {
"host": "web01",
"dc": "lga"
}
},
{
"metric": "sys.cpu.abc",
"timestamp": 1567764602,
"value": 9,
"tags": {
"host": "web02",
"dc": "lga"
}
}
]
Same data is also visible on the portal but I want to retrieve this data form TSDB by API.
I used this but it's not returning actual data.
http://localhost:4242/api/search/lookup?m=sys.cpu.nice{host=*}
{
"type": "LOOKUP",
"metric": "sys.cpu.nice",
"tags": [{
"key": "host",
"value": "*"
}],
"limit": 25,
"time": 6.0,
"results": [],
"startIndex": 0,
"totalResults": 0
}
Could you please help to get data back from the database. I need to send this data to some other system.
Try using the /api/query endpoint
In your case you could try one of the following GET requests:
http://localhost:4242/api/query?m=sum:cmp.sys.db{host=server01,tenant01}&start=1h-ago
http://localhost:4242/api/query?m=zimsum:cmp.sys.db{host=server01,tenant01}&start=1h-ago