Skip to content

Commit d3848f8

Browse files
committed
add curl example transfer offers
1 parent 71f292e commit d3848f8

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined
2+
# in your environmental variables or directly in your script
3+
ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \
4+
https://test.api.amadeus.com/v1/security/oauth2/token \
5+
-d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \
6+
| grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]')
7+
8+
curl -X POST -H "Authorization: Bearer $ACCESS_TOKEN" \
9+
-H "Content-Type: application/json" \
10+
https://test.api.amadeus.com/v1/shopping/transfer-offers \
11+
-d '{
12+
"startLocationCode": "CDG",
13+
"endAddressLine": "Avenue Anatole France, 5",
14+
"endCityName": "Paris",
15+
"endZipCode": "75007",
16+
"endCountryCode": "FR",
17+
"endName": "Souvenirs De La Tour",
18+
"endGeoCode": "48.859466,2.2976965",
19+
"transferType": "PRIVATE",
20+
"startDateTime": "2023-11-10T10:30:00",
21+
"providerCodes": "TXO",
22+
"passengers": 2,
23+
"stopOvers": [
24+
{
25+
"duration": "PT2H30M",
26+
"sequenceNumber": 1,
27+
"addressLine": "Avenue de la Bourdonnais, 19",
28+
"countryCode": "FR",
29+
"cityName": "Paris",
30+
"zipCode": "75007",
31+
"name": "De La Tours",
32+
"geoCode": "48.859477,2.2976985",
33+
"stateCode": "FR"
34+
}
35+
],
36+
"startConnectedSegment": {
37+
"transportationType": "FLIGHT",
38+
"transportationNumber": "AF380",
39+
"departure": {
40+
"localDateTime": "2023-11-10T09:00:00",
41+
"iataCode": "NCE"
42+
},
43+
"arrival": {
44+
"localDateTime": "2023-11-10T10:00:00",
45+
"iataCode": "CDG"
46+
}
47+
},
48+
"passengerCharacteristics": [
49+
{
50+
"passengerTypeCode": "ADT",
51+
"age": 20
52+
},
53+
{
54+
"passengerTypeCode": "CHD",
55+
"age": 10
56+
}
57+
]
58+
}'

0 commit comments

Comments
 (0)