I am trying to use the REST Revalidate Itinerary service provided by Sabre.If you have access to the sabre developer site, you can find the details here:
https://developer.sabre.com/docs/read/rest_apis/air/search/revalidate_itinerary
I am posting to api.sabre.com/v3.3.0/shop/flights/revalidate as instructed, but I am getting a 404 back with the message that "No service exists" at that URL.
Has anyone been able to get this to work, or does anyone know the correct URL?
Updated with the raw response, obtained using Fiddler:
HTTP/1.1 404 Not Found
date: Wed, 21 Feb 2018 17:05:39 GMT
EnvType: production
message-id: EogQto
singularityheader: appId=1448*ctrlguid=1516860998*acctguid=9e6c885b-de5c-4175-ac13-773e8d4b7ab2*ts=1519232739414*btid=16580*guid=5daa09fd-ca10-4c8b-b35c-968a410d211e*exitguid=1|1*unresolvedexitid=49225*tcop=1:2058128*cidfrom=171608*etypeorder=JMS*esubtype=JMS*cidto={[UNRESOLVED][49225]}*tcop=1:2058128
x-provider-instance-id: raf-darhlp010-8080
Content-Type: application/json;charset=UTF-8
Content-Length: 255
Server: Sabre Gateway
{"status":"Complete","reportingSystem":"RAF","timeStamp":"2018-02-21T17:05:39+00:00","type":"Application","errorCode":"WARN.RAF.APPLICATION","instance":"raf-darhlp010-8080","message":"No service exists for: /cto-darwin-raf/v3.4.0/shop/flights/revalidate"}
Here is my payload in full:
POST https: //api.havail.sabre.com/v3.4.0/shop/flights/revalidate?mode=live HTTP/1.1
Authorization: Bearer T1RLAQJ940LxYe01yXkBtjZ6g6PEJkjPfxDiW51CX1eYL52BV7ZR+vuQAACw70cYo2xd9slV8ZA8cpJFXg+4qGrxxg83PFKleE3Vm7AHTbrztkg3aHccOVLazItRcJmtR/Ohz96mz +em96HYv2n8SVBgdKTvcN1rwhBXrFsmGKY8E+LUK2wBPSQVz8kGmPW89G//EPp1igTJaaWZrJFxoq40G8SCS0HEyt3RTMNmVLtv7q0a+xuQWYJyGKpxSujRIeJzajN86YiJ7+Eck8rpyFnVOyIlKnO5fiX6C6E*
Content-Type: application/json; charset=utf-8
Host: api.havail.sabre.com
Content-Length: 1204
Expect: 100-continue
{
"OTA_AirLowFareSearchRQ": {
"POS": {
"Source": [
{
"RequestorID": {
"CompanyName": {
"Code": "TN"
},
"Type": "1",
"ID": "1"
},
"PseudoCityCode": "C94H"
}
]
},
"OriginDestinationInformation": [
{
"DepartureDateTime": "2018-03-23T08:50:00",
"OriginLocation": {
"LocationCode": "LHR"
},
"DestinationLocation": {
"LocationCode": "JFK"
},
"TPA_Extensions": {
"Flight": [
{
"OriginLocation": {
"LocationCode": "LHR"
},
"DestinationLocation": {
"LocationCode": "JFK"
},
"Airline": {
"Operating": "VS",
"Marketing": "DL"
},
"ClassOfService": "B",
"Number": 4370.0,
"DepartureDateTime": "2018-03-23T08:50:00",
"ArrivalDateTime": "2018-03-23T13:00:00",
"Type": "A"
}
]
},
"RPH": "1"
},
{
"DepartureDateTime": "2018-03-24T19:30:00",
"OriginLocation": {
"LocationCode": "JFK"
},
"DestinationLocation": {
"LocationCode": "LHR"
},
"TPA_Extensions": {
"Flight": [
{
"OriginLocation": {
"LocationCode": "JFK"
},
"DestinationLocation": {
"LocationCode": "LHR"
},
"Airline": {
"Operating": "VS",
"Marketing": "DL"
},
"ClassOfService": "B",
"Number": 4373.0,
"DepartureDateTime": "2018-03-24T19:30:00",
"ArrivalDateTime": "2018-03-25T07:30:00",
"Type": "A"
}
]
},
"RPH": "2"
}
],
"TravelerInfoSummary": {
"SeatsRequested": [
1
],
"AirTravelerAvail": [
{
"PassengerTypeQuantity": [
{
"Code": "ADT",
"Quantity": 1
}
]
}
],
"PriceRequestInformation": {
"TPA_Extensions": {}
}
}
}
}
You should probably not start using the endpoint you are using. According to the https://developer.sabre.com/resources/api_versioning it gets switched to https://api.havail.sabre.com by mid of the year. I guess you already use https?
Besides that it works for me when taking the sample payload and adjusting it for real data. Can you provide your header/payload?
Turns out it didn't like the querystring '?mode=live'. If I remove that, I get a response. We use that string in all our other REST requests to shop/flights/ but looks like it's not valid in this circumstance.
Also, thanks to Thomas for his help
Related
{
"data": [
{
"event_name": "ViewContent",
"event_time": 1620216748,
"action_source": "email",
"user_data": {
"em": "7b17fb0bd173f625b58636fb796407c22b3d16fc78302d79f0fd30c2fc2fc068",
"ph": null
},
"custom_data": {
"currency": "USD",
"value": "142.52"
}
}
],
"test_event_code": "TEST1234"
}
I am using the test JSON request, it does not throw error and gives
{
"events_received": 1,
"messages": [
],
"fbtrace_id": "As1JpX8LxeVtLP5XLSfY7Np"
}
But i am unable to get it under Facebook Event manager test events.
Try to insert this Json code:
You need only change the values of <A IP ADDRESS> and <YOUR TEST_CODE> with your data.
{
"data": [
{
"event_name": "Purchase",
"event_time": 1620921176,
"action_source": "website",
"user_data": {
"em": "7b17fb0bd173f625b58636fb796407c22b3d16fc78302d79f0fd30c2fc2fc068",
"client_user_agent": "mozilla",
"client_ip_address": "<A IP ADDRESS>"
},
"custom_data": {
"currency": "USD",
"value": "142.52"
}
}
],
"test_event_code": "<YOUR TEST_CODE>"
}
On my tests, it works after I insert these data:
"client_user_agent": "mozilla",
"client_ip_address": "<A IP ADDRESS>"
I have been trying to figure it out... I have tried quite a few things. Entering the IP did the trick. Not sure if that means there is something wrong, but I do know the conversation api test didn't work until we added the IP.
I am connecting to Dialogflow REST API v2beta1 to the method: projects.agent.sessions.detectIntent. In the first request I send a text and the response is returning the expected result which contains outputContexts; when I made the 2nd request I send the context and it should find the intent which is linked to that context, but instead of that it is returning the Default Fallback Intent.
What may be the problem on the 2nd request?
Here are the URL and requests with their respective responses, and below I added the screenshots of the intents expected to match.
URL
https://dialogflow.googleapis.com/v2beta1/projects/project-name/agent/sessions/12343:detectIntent
1st request
{
"queryInput":{
"text":{
"text":"play a video about love",
"languageCode":"en"
}
}
}
1st response
{
"responseId": "15a3b767-52fe-4fc2-8ffd-9d7bb9c6961a",
"queryResult": {
"queryText": "play a video about love",
"action": "video.play",
"parameters": {
"organization": "",
"tag": "Love",
"item": ""
},
"allRequiredParamsPresent": true,
"fulfillmentText": "Here is a video about Love!",
"fulfillmentMessages": [
{
"platform": "ACTIONS_ON_GOOGLE",
"simpleResponses": {
"simpleResponses": [
{
"textToSpeech": "Here is a video about Love!"
}
]
}
},
{
"text": {
"text": [
"Here is a video about Love!"
]
}
}
],
"outputContexts": [
{
"name": "projects/project-name/agent/sessions/12343/contexts/play-video",
"lifespanCount": 5,
"parameters": {
"tag": "Love",
"organization": "",
"tag.original": "love",
"item": "",
"organization.original": "",
"item.original": ""
}
}
],
"intent": {
"name": "projects/project-name/agent/intents/9e5d2bbc-81f3-4700-8740-01504b05443f",
"displayName": "video-play"
},
"intentDetectionConfidence": 1,
"languageCode": "en"
}
}
2nd request (where the problem should be)
{
"queryParams":{
"contexts":[
{
"name":"projects/project-name/agent/sessions/12342/contexts/play-video"
}
]
},
"queryInput":{
"text":{
"text":"that video matters a lot for me",
"languageCode":"en"
}
}
}
2nd response
{
"responseId": "40d1f94f-4673-4644-aa53-99c854ff2596",
"queryResult": {
"queryText": "that video matters a lot for me",
"action": "input.unknown",
"parameters": {},
"allRequiredParamsPresent": true,
"fulfillmentText": "Can you say that again?",
"fulfillmentMessages": [
{
"text": {
"text": [
"Sorry, what was that?"
]
}
}
],
"intent": {
"name": "projects/project-name/agent/intents/10c88e8d-f16a-4905-b829-f596d3b3c588",
"displayName": "Default Fallback Intent",
"isFallback": true
},
"intentDetectionConfidence": 1,
"languageCode": "en"
}
}
Screenshots of the intents expected to match
1st intent
2nd intent
Useful documentation
Doc of the method: https://dialogflow.com/docs/reference/api-v2/rest/v2beta1/projects.agent.sessions/detectIntent
Doc of the Context object: https://dialogflow.com/docs/reference/api-v2/rest/Shared.Types/Context
Doc of the Params object to be sent: https://dialogflow.com/docs/reference/api-v2/rest/v2beta1/QueryParameters
It looks like your second request has an incomplete context. Although you're specifying the name, you're not including the lifespanCount parameter. Since you're not providing a parameter, it defaults to 0, which means that it has timed out.
You should send back exactly what you received from the outputContext attribute in the previous reply.
{
"queryParams":{
"contexts":[
{
"name": "projects/project-name/agent/sessions/12343/contexts/play-video",
"lifespanCount": 5,
"parameters": {
"tag": "Love",
"organization": "",
"tag.original": "love",
"item": "",
"organization.original": "",
"item.original": ""
}
}
]
},
"queryInput":{
"text":{
"text":"that video matters a lot for me",
"languageCode":"en"
}
}
}
I'm trying to send an envelope in DocuSign using REST API. For adding the document to envelopes I'm using multipart/form-data POST method.
I tried sending this request using POSTMAN but I'm getting a below response:
{
"errorCode": "INVALID_CONTENT_TYPE",
"message": "Content Type specified is not supported. Content-Type for part[0] must be application/json or application/xml"
}
This is my POSTMAN request:
POST /restapi/v2/accounts/****/envelopes HTTP/1.1
Host: demo.docusign.net
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
Authorization: Bearer *********
Cache-Control: no-cache
Postman-Token: c0b940e1-4b6c-4848-abd1-ed5c9c712cb5
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name=""
{
"status": "sent",
"emailSubject": "Example of one recipient, type signer",
"documents": [{
"documentId": "1",
"name": "contract.pdf",
}],
"recipients": {
"signers": [{
"name": "Lisa Simpson",
"email": "lisa#email.com",
"recipientId": "1",
"routingOrder": "1",
"tabs": {
"signHereTabs": [{
"xPosition": "150",
"yPosition": "200",
"documentId": "1",
"pageNumber": "1"
}],
}
}]
}
}
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="Test.pdf"
Content-Type: application/pdf
------WebKitFormBoundary7MA4YWxkTrZu0gW--
My questions are:
Is there a way in POSTMAN to specify the Content-Type for part[0]?
What should be the key names for part[0] & part[1]?
How to pass documentid in part[1]?
I'm referring: https://docs.docusign.com/esign/restapi/Envelopes/Envelopes/create/#examples
REST API documentation
See below for a proper self-contained working DocuSign envelope using multi-part form vs multipart/form-data -
DocuSign Support Case 04093516 is closed and a Jira ticket was filed for the erroneous mention of form-data in the documentation about sending envelopes via REST API.
Hard returns and spacing are critical. Also, recommend you update email addresses to your test Gmail account, notice the same account with + can be used.
If using Postman make sure you are using "RAW" not form-data, x-www-form-urlencoded or binary. See image below:
Link here as well - https://blog.grigsbyconsultingllc.com/wp-content/uploads/Screenshot-2018-04-18-07.26.26.png
You still need headers, specifically content-type and authentication type aka :
-H 'content-type: multipart/form-data; boundary=AAA' \
-H 'x-docusign-authentication; See Stack Overflow link How should the header X-DocuSign-Authentication be used for REST and SOAP?
--AAA
Content-Type: application/json
Content-Disposition: form-data
{
"emailBlurb": "Test for CEFTAF Lab 2 Custom Fields Recipient Fields Document Fields",
"emailSubject": "Test for Dev 201 Lab 2",
"status": "created",
"notification":{
"useAccountDefaults":"false",
"reminders":{
"reminderEnabled":"true",
"reminderDelay":"2",
"reminderFrequency":"2"
},
"expirations":{
"expireEnabled":"true",
"expireAfter":"15",
"expireWarn":"1"
}
},
"compositeTemplates": [{
"inlineTemplates": [{
"sequence": "1",
"customFields": {
"textCustomFields": [
{
"fieldId": "123",
"name": "MYCustomID",
"show": "false",
"required": "false",
"value": "myId012345"
}
],
"listCustomFields": [
{
"listItems": [
"elementValue1","elementValue2","elementValue3"
],
"fieldId": "1234",
"name": "myArrayListofItems",
"show": "false",
"required": "false",
"value": "3"
}
]
},
"documents": [{
"documentId": "1",
"name": "test1.txt",
"documentFields": [
{
"name": "Test1",
"value": "value for test1"
}
],
},
{
"documentId": "2",
"name": "test2.txt"
},
{
"documentId": "3",
"name": "test3.txt"
}
],
"recipients": {
"carbonCopies": [
{
"email": "dsproservedemosoapui+Testcc#gmail.com",
"name": "David Grigsby (see all document)",
"recipientId": "3",
"routingOrder": "3"
},
{
"email": "dsproservedemosoapui+Testcc1#gmail.com",
"name": "David Grigsby (see all)",
"recipientId": "4",
"routingOrder": "4"
}
],
"signers": [{
"recipientId": "1",
"customFields": [
"Recip 1 ID 1234"
],
"name": "David Grigsby (Sees all)",
"email": "dsproservedemosoapui+Test1#gmail.com",
"routingOrder": "1",
"tabs": {
"signHereTabs": [{
"anchorString": "Sign1",
"tabLabel": "Sign Here 1"
}]
}
},
{
"recipientId": "2",
"name": "David Grigsby (sees all )",
"email": "david.grigsby#yahoo.com",
"routingOrder": "2",
"tabs": {
"signHereTabs": [{
"anchorString": "Sign2",
"tabLabel": "Sign Here 2"
}]
}
}
]
}
}]
}]
}
--AAA
Content-Type: application/txt
Content-Disposition: file; filename="test1.txt"; documentid=1
Test Document 1
Sign1 Here _______________________________ Custom1 Approve:
Sign2 Here _______________________________ Custom2 Approve:
--AAA
Content-Type: application/txt
Content-Disposition: file; filename="test2.txt"; documentid=2
Test Document 2
Sign1 Here _______________________________
--AAA
Content-Type: application/txt
Content-Disposition: file; filename="test3.txt"; documentid=3
Test Document 3
No Tabs for anyone means visbile to all by default unless excluded
--AAA--
And the difference for a PDF is below, recommend using Base64
--AAA
Content-Type: application/pdf
Content-Disposition: file; filename="f4506t.pdf"; documentid=1
Content-Transfer-Encoding: base64
JVBERi0xLjcNJeLjz9MNCjMwMSAwIG9iag08PC9MaW5lYXJpemVkIDEvTCA3NDAzMi9PIDMwMy9F
IDMzNjI2L04gMi9UIDczNjM4L0ggWyA2MzAgMjk2XT4+DWVuZG9iag0gICAgICAgICAgICAgICAg
.... pdf body bulk removed ......
o4IlmH0CxPYUYWBiYGBUB5PVDADOVQiaCmVuZHN0cmVhbQplbmRvYmoKc3RhcnR4cmVmCjg1MDUz
CiUlRU9GCg==
--AAA--
Image of Note from DocuSign Case:
I try to familiarize myself with the Reindexing API of ElasticSearch and the use of Painless scripts.
I have the following model:
"mappings": {
"customer": {
"properties": {
"firstName": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"lastName": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"dateOfBirth": {
"type": "date"
}
}
}
}
I would like to reindex all documents from test-v1 to test-v2 and apply a few transformations on them (for example extract the year part of dateOfBirth, convert a date value to a timestamp, etc) and save the result as a new field. But I got an issue when I tried to access it.
When I made the following call, I got an error:
POST /_reindex?pretty=true&human=true&wait_for_completion=true HTTP/1.1
Host: localhost:9200
Content-Type: application/json
{
"source": {
"index": "test-v1"
},
"dest": {
"index": "test-v2"
},
"script": {
"lang": "painless",
"inline": "ctx._source.yearOfBirth = ctx._source.dateOfBirth.getYear();"
}
}
And the response:
{
"error": {
"root_cause": [
{
"type": "script_exception",
"reason": "runtime error",
"script_stack": [
"ctx._source.yearOfBirth = ctx._source.dateOfBirth.getYear();",
" ^---- HERE"
],
"script": "ctx._source.yearOfBirth = ctx._source.dateOfBirth.getYear();",
"lang": "painless"
}
],
"type": "script_exception",
"reason": "runtime error",
"script_stack": [
"ctx._source.yearOfBirth = ctx._source.dateOfBirth.getYear();",
" ^---- HERE"
],
"script": "ctx._source.yearOfBirth = ctx._source.dateOfBirth.getYear();",
"lang": "painless",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "Unable to find dynamic method [getYear] with [0] arguments for class [java.lang.String]."
}
},
"status": 500
}
According to this tutorial Date fields are exposed as ReadableDateTime so they support methods like getYear, and getDayOfWeek. and indeed, the Reference mentions those as supported methods.
Still, the response mentions [java.lang.String] as the type of the dateOfBirth property. I could just parse it to e.g. an OffsetDateTime, but I wonder why it is a string.
Anyone has a suggestion what I'm doing wrong?
I've setup a resource in API Gateway with an API key and a Mock Integration. When I test in the console, I can see the canned JSON response which I setup in the integraion response.
However, when I test externally using Postman, I can see the expected status code in the response (201) but the response body is empty.
Would anyone be able to shed some light over why this might be?
Many thanks
Ben
Just to make sure, did you deploy the latest version of your API? I used the sample API below which worked fine for me. Could you try this one?
{
"swagger": "2.0",
"info": {
"version": "2016-04-19T19:54:16Z",
"title": "my-mock-api"
},
"basePath": "/prod",
"schemes": [
"https"
],
"paths": {
"/": {
"get": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "200 response",
"schema": {
"$ref": "#/definitions/Empty"
}
}
},
"x-amazon-apigateway-integration": {
"responses": {
"default": {
"statusCode": "200",
"responseTemplates": {
"application/json": "{\"test\":\"test\"}"
}
}
},
"requestTemplates": {
"application/json": "{\"statusCode\": 200}"
},
"type": "mock"
}
}
}
},
"definitions": {
"Empty": {
"type": "object"
}
}
}