Searching YouTube by video quality, duration, upload date and keywords? - api

Although I can easily do this on the YouTube.com advanced search page, I can't seem to get it to work with their API.
E.g.: From the explorer page
Does anyone know the trick to getting this to work?

You can search by video quality, duration, upload date, and keywords using the Search of the YouTube Data API v3
https://developers.google.com/youtube/v3/docs/search
you can use the following filters:
publishedAfter / datetime
publishedBefore / datetime
q / string (keywords)
videoDefinition / string (any /high /standard )
videoDuration / string (any /long /medium /short )
and also you must be careful and set the type parameter as video to specify this filters.
This is a sample call:
Request:
GET https://www.googleapis.com/youtube/v3/search?part=snippet&publishedAfter=2011-01-01T00%3A00%3A00Z&q=coke&type=video&videoDefinition=high&videoDuration=short&key={YOUR_API_KEY}
Response:
200 OK
- Show headers -
{
"kind": "youtube#searchListResponse",
"etag": "\"rFqCJSkEICLP3Hq6a4AADI7kf48/aTddnYr9r7d0D4Q5PzPGfWpsecI\"",
"pageInfo": {
"totalResults": 1000000,
"resultsPerPage": 5
},
"nextPageToken": "CAUQAA",
"items": [
{
"kind": "youtube#searchResult",
"etag": "\"rFqCJSkEICLP3Hq6a4AADI7kf48/Ej9FPd2YyubbQoYtuBZ_tT1Zjck\"",
"id": {
"kind": "youtube#video",
"videoId": "5T68TvdoSbI"
},
"snippet": {
"publishedAt": "2013-06-20T15:00:35.000Z",
"channelId": "UC1zZE_kJ8rQHgLTVfobLi_g",
"title": "Self Freezing Coca-Cola (The trick that works on any soda!)",
"description": "Take any bottle of soda, and get it to freeze on command! This \"super cool\" trick works with cans of soda as well. To date, I haven't seen any tutorials on e...",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/5T68TvdoSbI/default.jpg"
},
"medium": {
"url": "https://i.ytimg.com/vi/5T68TvdoSbI/mqdefault.jpg"
},
"high": {
"url": "https://i.ytimg.com/vi/5T68TvdoSbI/hqdefault.jpg"
}
},
"channelTitle": "01032010814"
}
},
{
"kind": "youtube#searchResult",
"etag": "\"rFqCJSkEICLP3Hq6a4AADI7kf48/TAH9npB-WK5-tntpUczojivt_nk\"",
"id": {
"kind": "youtube#video",
"videoId": "FaMWxLCGY0U"
},
"snippet": {
"publishedAt": "2011-04-23T00:57:00.000Z",
"channelId": "UCIgKGGJkt1MrNmhq3vRibYA",
"title": "Gallium Induced Structural Failure of a Coke Can",
"description": "We show how a normally strong and robust coke can is turned into the equivalent of wet tissue paper with gallium. If you want some gallium yourself, you can ...",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/FaMWxLCGY0U/default.jpg"
},
"medium": {
"url": "https://i.ytimg.com/vi/FaMWxLCGY0U/mqdefault.jpg"
},
"high": {
"url": "https://i.ytimg.com/vi/FaMWxLCGY0U/hqdefault.jpg"
}
},
"channelTitle": "NurdRage"
}
},
{
"kind": "youtube#searchResult",
"etag": "\"rFqCJSkEICLP3Hq6a4AADI7kf48/ZbkW-ovCwrd7bU0s44Yc6ZNF8uQ\"",
"id": {
"kind": "youtube#video",
"videoId": "KEBJmZL8G1E"
},
"snippet": {
"publishedAt": "2012-06-06T20:16:20.000Z",
"channelId": "UCosXctaTYxN4YPIvI5Fpcrw",
"title": "The Most Outrageous Way to Share a Coke",
"description": "What is the most outrageous way to share a Coke? Watch this video to see what iJustine, Josh TheComputerNerd01 and a few new friends came up with -- an ...",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/KEBJmZL8G1E/default.jpg"
},
"medium": {
"url": "https://i.ytimg.com/vi/KEBJmZL8G1E/mqdefault.jpg"
},
"high": {
"url": "https://i.ytimg.com/vi/KEBJmZL8G1E/hqdefault.jpg"
}
},
"channelTitle": "cocacola"
}
},
{
"kind": "youtube#searchResult",
"etag": "\"rFqCJSkEICLP3Hq6a4AADI7kf48/I04dl1Hbm3FTzhGu8xIbRfHQ5XM\"",
"id": {
"kind": "youtube#video",
"videoId": "b6u9WJ01Oxs"
},
"snippet": {
"publishedAt": "2011-09-28T01:01:55.000Z",
"channelId": "UCUK0HBIBWgM2c4vsPhkYY4w",
"title": "EPIC Mentos and Coke - The Slow Mo Guys",
"description": "Volume UP, Watch in HD! Gav and Dan bring you the most epic mentos and coke video ever. Well, I say epic... It's more accurately the MOST OVERLY DRAMATIC men...",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/b6u9WJ01Oxs/default.jpg"
},
"medium": {
"url": "https://i.ytimg.com/vi/b6u9WJ01Oxs/mqdefault.jpg"
},
"high": {
"url": "https://i.ytimg.com/vi/b6u9WJ01Oxs/hqdefault.jpg"
}
},
"channelTitle": "theslowmoguys"
}
},
{
"kind": "youtube#searchResult",
"etag": "\"rFqCJSkEICLP3Hq6a4AADI7kf48/JlSU5F38dpMSZwynbS2ztIpSNr8\"",
"id": {
"kind": "youtube#video",
"videoId": "gy5hTC1ox9A"
},
"snippet": {
"publishedAt": "2013-05-29T06:22:07.000Z",
"channelId": "UCDZESjYAwh-ws7ZSZZ8DKeg",
"title": "2 Liter Diet Coke Challenge (No Burping)",
"description": "L.A. BEAST responds to a challenge created by fellow competitive eater Matt \"The Megatoad\" Stonie, in which one must drink an entire 2 liter bottle of Diet C...",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/gy5hTC1ox9A/default.jpg"
},
"medium": {
"url": "https://i.ytimg.com/vi/gy5hTC1ox9A/mqdefault.jpg"
},
"high": {
"url": "https://i.ytimg.com/vi/gy5hTC1ox9A/hqdefault.jpg"
}
},
"channelTitle": "skippy62able"
}
}
]
}

Related

Why lastfm api returns the wrong image?

When I get track.search or user.getLovedTracks response, they have an image, but if I saw on any of the provided links then there will be a white image with a star, although if I go to my loved tracks page in lastfm the images will be correct.
For the example.
At lastfm:
https://i.stack.imgur.com/OKc5e.png
link to image: https://lastfm.freetls.fastly.net/i/u/64s/9c7a96efcdfa4e03cc8e1b65daac5281.jpg
At my service:
https://i.stack.imgur.com/dpIhj.png
link to image in request response: https://lastfm.freetls.fastly.net/i/u/64s/2a96cbd8b46e442fc41c2b86b821562f.png
The api returns a whole array of links to images, but they are all incorrect
https://i.stack.imgur.com/Uiwrl.png
If you send a request with the track.getInfo method will response like:
{
"track": {
"name": "Без ключа",
"url": "https://www.last.fm/music/Pharaoh/_/%D0%91%D0%B5%D0%B7+%D0%BA%D0%BB%D1%8E%D1%87%D0%B0",
"duration": "159000",
"streamable": {
"#text": "0",
"fulltrack": "0"
},
"listeners": "10491",
"playcount": "78974",
"artist": {
"name": "Pharaoh",
"mbid": "a6ed750a-7293-4e08-ba03-832373eb136b",
"url": "https://www.last.fm/music/Pharaoh"
},
"album": {
"artist": "Pharaoh",
"title": "Правило",
"url": "https://www.last.fm/music/Pharaoh/%D0%9F%D1%80%D0%B0%D0%B2%D0%B8%D0%BB%D0%BE",
"image": [{
"#text": "https://lastfm.freetls.fastly.net/i/u/34s/6e92fe0cff920f671ee5eb4e2f0f4e59.png",
"size": "small"
}, {
"#text": "https://lastfm.freetls.fastly.net/i/u/64s/6e92fe0cff920f671ee5eb4e2f0f4e59.png",
"size": "medium"
}, {
"#text": "https://lastfm.freetls.fastly.net/i/u/174s/6e92fe0cff920f671ee5eb4e2f0f4e59.png",
"size": "large"
}, {
"#text": "https://lastfm.freetls.fastly.net/i/u/300x300/6e92fe0cff920f671ee5eb4e2f0f4e59.png",
"size": "extralarge"
}]
},
"toptags": {
"tag": []
}
}
}
and the links in the album image will be correct

When using the Quickbooks API explorer, read a vendor endpoint returns additional fields. How do I get these fields in actual API results?

Response from API via API explorer(by Intuit)
{
"Vendor": {
"BillAddr": {
"Id": "9",
"Line1": "31/2-34/2B, G01, Ground Floor (P V Enclave, V-Step Road)",
"Line2": "Kempapura",
"City": "Bangalore",
"Country": "India",
"CountrySubDivisionCode": "karnataka",
"PostalCode": "560037"
},
"BusinessNumber": "ABPFA3772K",
"Balance": 12960,
"BillRate": 0,
"Vendor1099": false,
"CurrencyRef": {
"value": "INR",
"name": "Indian Rupee"
},
"TDSEnabled": true,
"TDSEntityTypeId": 2,
"TDSSectionTypeId": 20,
"TDSOverrideThreshold": false,
"GSTIN": "29ABPFA3772K1ZT",
"GSTRegistrationType": "GST_REG_REG",
"CostRate": 0,
"domain": "QBO",
"sparse": false,
"Id": "5",
"SyncToken": "3",
"MetaData": {
"CreateTime": "2021-11-29T04:13:02-08:00",
"LastUpdatedTime": "2022-06-19T11:18:01-07:00"
},
"CompanyName": "Asyncauto",
"DisplayName": "Asyncauto",
"PrintOnCheckName": "Asyncauto",
"Active": true,
"V4IDPseudonym": "002085e0c7fca007484293913d58943f84b215",
"PrimaryPhone": {
"FreeFormNumber": "1231231234"
},
"PrimaryEmailAddr": {
"Address": "123123#mralbert.in"
}
},
"time": "2022-06-19T19:00:23.349-07:00"
}
Response from the actual API endpoint (quickbooks.api.intuit.com)
{
"Vendor": {
"BillAddr": {
"Id": "9",
"Line1": "31/2-34/2B, G01, Ground Floor (P V Enclave, V-Step Road)",
"Line2": "Kempapura",
"City": "Bangalore",
"Country": "India",
"CountrySubDivisionCode": "karnataka",
"PostalCode": "560037"
},
"BusinessNumber": "ABPFA3772K",
"Balance": 12960.00,
"Vendor1099": false,
"CurrencyRef": {
"value": "INR",
"name": "Indian Rupee"
},
"domain": "QBO",
"sparse": false,
"Id": "5",
"SyncToken": "3",
"MetaData": {
"CreateTime": "2021-11-29T04:13:02-08:00",
"LastUpdatedTime": "2022-06-19T11:18:01-07:00"
},
"CompanyName": "Asyncauto",
"DisplayName": "Asyncauto",
"PrintOnCheckName": "Asyncauto",
"Active": true,
"PrimaryPhone": {
"FreeFormNumber": "1231231234"
},
"PrimaryEmailAddr": {
"Address": "123123#mralbert.in"
}
},
"time": "2022-06-19T19:04:59.703-07:00"
}
Notice that in the second case these fields - "TDSEnabled","TDSEntityTypeId","TDSSectionTypeId","TDSOverrideThreshold","GSTIN","GSTRegistrationType", are missing.
How do I get these fields in the regular production endpoint?
Try using Postman and see if issue persist then you need to talk with quickbooks support.
I have found that in indian edition of quickbooks still has many issue open.

Error API_KEY_HTTP_REFERRER_BLOCKED ocurred at using Youtube Data API v3

When making a request to:
https://www.googleapis.com/youtube/v3/search?part=snippet&type=video&maxResults=5&key=<MY_API_KEY>&q=dogs
I get the following error response:
"error": {
"code": 403,
"message": "Requests from referer \u003cempty\u003e are blocked.",
"errors": [
{
"message": "Requests from referer \u003cempty\u003e are blocked.",
"domain": "global",
"reason": "forbidden"
}
],
"status": "PERMISSION_DENIED",
"details": [
{
"#type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "API_KEY_HTTP_REFERRER_BLOCKED",
"domain": "googleapis.com",
"metadata": {
"consumer": "projects/119952101582",
"service": "youtube.googleapis.com"
}
}
]
}
}
The error is because the http referrer of the request violates API key HTTP restrictions.
Check your API_KEY settings of your project.
You can try the request in the documentation feature and see the results:
URL: https://youtube.googleapis.com/youtube/v3/search?part=snippet&maxResults=5&type=video&key=[YOUR_API_KEY]
Results:
{
"kind": "youtube#searchListResponse",
"etag": "4Jd7oMmX6dodoqxeiB24wLkVMPY",
"nextPageToken": "CAUQAA",
"regionCode": "CO",
"pageInfo": {
"totalResults": 1000000,
"resultsPerPage": 5
},
"items": [
{
"kind": "youtube#searchResult",
"etag": "ZQVJo2CIwtFFTHVA4hq4gLBld_w",
"id": {
"kind": "youtube#video",
"videoId": "Ci3TMqWfNLs"
},
"snippet": {
"publishedAt": "2020-09-17T22:08:22Z",
"channelId": "UCKTWUJqT3NSZ50I49ExjWZQ",
"title": "Master KG - Jerusalema feat. Micro TDH & Greeicy & Nomcebo Zikode – [Remix] (Official Video)",
"description": "Master KG - Jerusalema feat. Micro TDH & Greeicy & Nomcebo Zikode – [Remix] (Official Video) SUBSCRIBETE ▷ https://war.lnk.to/subscribe Ya disponible en ...",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/Ci3TMqWfNLs/default.jpg",
"width": 120,
"height": 90
},
"medium": {
"url": "https://i.ytimg.com/vi/Ci3TMqWfNLs/mqdefault.jpg",
"width": 320,
"height": 180
},
"high": {
"url": "https://i.ytimg.com/vi/Ci3TMqWfNLs/hqdefault.jpg",
"width": 480,
"height": 360
}
},
"channelTitle": "Warner Música",
"liveBroadcastContent": "none",
"publishTime": "2020-09-17T22:08:22Z"
}
},
{
"kind": "youtube#searchResult",
"etag": "vgvtwWrC2W3mxKzGxE2tL8K5xC4",
"id": {
"kind": "youtube#video",
"videoId": "dZauWAlZwl4"
},
"snippet": {
"publishedAt": "2020-12-04T00:00:08Z",
"channelId": "UCEFNzT2RoVqGkV4e3Osyx4A",
"title": "Piso 21 & Maluma - Más De La Una (Video Oficial)",
"description": "Piso 21 & Maluma - Más De La Una (Video Oficial) Suscríbete ahora al canal oficial de Piso 21: http://bit(.)ly/Piso21 Escucha todos los éxitos de Piso 21 aquí: ...",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/dZauWAlZwl4/default.jpg",
"width": 120,
"height": 90
},
"medium": {
"url": "https://i.ytimg.com/vi/dZauWAlZwl4/mqdefault.jpg",
"width": 320,
"height": 180
},
"high": {
"url": "https://i.ytimg.com/vi/dZauWAlZwl4/hqdefault.jpg",
"width": 480,
"height": 360
}
},
"channelTitle": "Piso 21",
"liveBroadcastContent": "none",
"publishTime": "2020-12-04T00:00:08Z"
}
},
{
"kind": "youtube#searchResult",
"etag": "KUGKha-wikLcojZUG_IFiIDfqns",
"id": {
"kind": "youtube#video",
"videoId": "zLX_GcXt2pI"
},
"snippet": {
"publishedAt": "2015-10-15T05:00:01Z",
"channelId": "UC5imdbLT1yRvjbyqeHhnt0A",
"title": "Manuel Medrano - Bajo El Agua (Video Oficial)",
"description": "Descarga en iTunes: https://itunes.apple.com/co/album/bajo-el-agua-single/id1015028641 Adquiere en Google Play: ...",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/zLX_GcXt2pI/default.jpg",
"width": 120,
"height": 90
},
"medium": {
"url": "https://i.ytimg.com/vi/zLX_GcXt2pI/mqdefault.jpg",
"width": 320,
"height": 180
},
"high": {
"url": "https://i.ytimg.com/vi/zLX_GcXt2pI/hqdefault.jpg",
"width": 480,
"height": 360
}
},
"channelTitle": "Manuel Medrano",
"liveBroadcastContent": "none",
"publishTime": "2015-10-15T05:00:01Z"
}
},
{
"kind": "youtube#searchResult",
"etag": "w6n0QzKBHByHu-HNiG8Lh3SkNUA",
"id": {
"kind": "youtube#video",
"videoId": "0EqHqPvXcMU"
},
"snippet": {
"publishedAt": "2019-09-06T05:00:04Z",
"channelId": "UCEFNzT2RoVqGkV4e3Osyx4A",
"title": "Piso 21 & Christian Nodal - Pa' Olvidarme De Ella (Video Oficial)",
"description": "No olvides suscribirte al canal de Piso 21 para ver los últimos videos musicales oficiales, audio oficial, álbumes y más! Sigue a Piso 21 en: Facebook: ...",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/0EqHqPvXcMU/default.jpg",
"width": 120,
"height": 90
},
"medium": {
"url": "https://i.ytimg.com/vi/0EqHqPvXcMU/mqdefault.jpg",
"width": 320,
"height": 180
},
"high": {
"url": "https://i.ytimg.com/vi/0EqHqPvXcMU/hqdefault.jpg",
"width": 480,
"height": 360
}
},
"channelTitle": "Piso 21",
"liveBroadcastContent": "none",
"publishTime": "2019-09-06T05:00:04Z"
}
},
{
"kind": "youtube#searchResult",
"etag": "wHEXK_WA_JcIMFQ89iipYVAxp7U",
"id": {
"kind": "youtube#video",
"videoId": "W4dioKwTm1A"
},
"snippet": {
"publishedAt": "2021-10-15T00:00:12Z",
"channelId": "UClZuKq2m0Qu-HkopkSBLpEw",
"title": "Lalo Ebratt, Maluma - Sukutubla (Official Video)",
"description": "Lalo Ebratt, Maluma - Sukutubla (Official Video) Top Hits: https://smarturl.it/malumatophits My Channel: https://smarturl.it/ytmaluma Maluma: ...",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/W4dioKwTm1A/default.jpg",
"width": 120,
"height": 90
},
"medium": {
"url": "https://i.ytimg.com/vi/W4dioKwTm1A/mqdefault.jpg",
"width": 320,
"height": 180
},
"high": {
"url": "https://i.ytimg.com/vi/W4dioKwTm1A/hqdefault.jpg",
"width": 480,
"height": 360
}
},
"channelTitle": "Maluma",
"liveBroadcastContent": "none",
"publishTime": "2021-10-15T00:00:12Z"
}
}
]
}

Bot duplicates user messages when I use DirectLine channel

I am using bot framework v4. I have developed a chatbot using .Net Core. The bot is integrated with LUIS and Qna Maker. One issue I am facing is that the bot duplicates the message that comes from the user. Please look at the screenshot below:
The replies I get from the bot are perfectly fine. The flow of the bot is as intended. I just cannot figure out why the message from user is being duplicated. I am using DirectLine for this. I will share whatever code part is needed.
{
"activities": [
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000000",
"timestamp": "2019-12-02T19:41:57.1284328Z",
"channelId": "directline",
"from": {
"id": "CivicDevBot",
"name": "CivicChat"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "Container",
"items": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "Image",
"size": "large",
"url": "https://i.imgur.com/ViaEUnA.png"
}
]
}
],
"horizontalAlignment": "Center"
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "TextBlock",
"size": "large",
"weight": "bolder",
"color": "light",
"text": "Welcome to CIVIC Financial Services",
"wrap": true
},
{
"type": "TextBlock",
"size": "large",
"weight": "bolder",
"color": "light",
"text": "I am S.U.E",
"wrap": true
},
{
"type": "TextBlock",
"color": "light",
"text": "I can help you answer your questions. Familiarize yourself with CIVIC Financial Services.",
"wrap": true
},
{
"type": "TextBlock",
"color": "light",
"text": "If you want to talk to a Customer Service Agent, just type \"I want to talk to a Customer Service Agent\".",
"wrap": true
}
],
"separator": true,
"horizontalAlignment": "Left"
}
]
}
]
}
],
"actions": [
{
"type": "Action.Submit",
"data": {
"action": "aboutCivic"
},
"title": "About CIVIC"
},
{
"type": "Action.ShowCard",
"card": {
"type": "AdaptiveCard",
"actions": [
{
"type": "Action.ShowCard",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "We are open from Monday through Friday from 8:00am to 6:00pm.",
"wrap": true
}
],
"style": "emphasis"
},
"title": "When are you open?"
},
{
"type": "Action.ShowCard",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "Image",
"size": "stretch",
"url": "https://i.imgur.com/gBVgI25.png",
"horizontalAlignment": "center"
},
{
"type": "TextBlock",
"text": "AZ, CA, CO, FL, GA, HI, NC, NV, OR, SC, TN, TX, UT, VA & WA",
"wrap": true
}
],
"style": "emphasis"
},
"title": "Do you have an office near me? "
},
{
"type": "Action.ShowCard",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "8 to 10 days, it all depends on how it takes to get access to the property.",
"wrap": true
}
],
"style": "emphasis"
},
"title": "How quickly can we close? "
}
],
"style": "emphasis"
},
"title": "FAQs"
}
]
}
}
],
"entities": [],
"replyToId": "8WGOnspSxN3"
},
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000001",
"timestamp": "2019-12-02T19:43:39.96502Z",
"serviceUrl": "https://directline.botframework.com/",
"channelId": "directline",
"from": {
"id": "r_1575315715",
"name": "",
"role": "user"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"textFormat": "plain",
"locale": "en-GB",
"text": "teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"entities": [
{
"type": "ClientCapabilities",
"requiresBotState": true,
"supportsListening": true,
"supportsTts": true
}
],
"channelData": {
"siteDomain": "https://websiteae1.stackblitz.io/"
}
},
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000002",
"timestamp": "2019-12-02T19:43:41.7278914Z",
"channelId": "directline",
"from": {
"id": "CivicDevBot",
"name": "CivicChat"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"text": "Sorry, I didn't understand. Consider rephrasing your question or contacting a customer agent",
"attachments": [],
"entities": [],
"replyToId": "BR1wBZw7w2852JMLobk0EC-o|0000001"
},
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000003",
"timestamp": "2019-12-02T20:00:25.784598Z",
"serviceUrl": "https://directline.botframework.com/",
"channelId": "directline",
"from": {
"id": "r_1575315715",
"name": "",
"role": "user"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"textFormat": "plain",
"locale": "en-GB",
"text": "helo",
"channelData": {
"siteDomain": "https://websiteae1.stackblitz.io/"
}
},
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000004",
"timestamp": "2019-12-02T20:00:26.5739342Z",
"channelId": "directline",
"from": {
"id": "CivicDevBot",
"name": "CivicChat"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"text": "Sorry, I didn't understand. Consider rephrasing your question or contacting a customer agent",
"attachments": [],
"entities": [],
"replyToId": "BR1wBZw7w2852JMLobk0EC-o|0000003"
},
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000005",
"timestamp": "2019-12-02T20:00:27.3293896Z",
"serviceUrl": "https://directline.botframework.com/",
"channelId": "directline",
"from": {
"id": "r_1575315715",
"name": "",
"role": "user"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"textFormat": "plain",
"locale": "en-GB",
"text": "hello",
"channelData": {
"siteDomain": "https://websiteae1.stackblitz.io/"
}
},
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000006",
"timestamp": "2019-12-02T20:00:27.6064185Z",
"channelId": "directline",
"from": {
"id": "CivicDevBot",
"name": "CivicChat"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"text": "Hello",
"inputHint": "acceptingInput",
"attachments": [],
"entities": [],
"replyToId": "BR1wBZw7w2852JMLobk0EC-o|0000005"
}
],
"watermark": "6"
}

Quickbooks API: How to generate purchase order against the orders placed by guest in quickbooks using api?

I have developed eCommerce website with OpenCart framework where when customer places order purchase order should be created in QuickBooks.
I have referred this documentation https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/purchaseorder
The api to create a purchase order accepts following json input
{
"PurchaseOrder": {
"DocNumber": "1005",
"SyncToken": "0",
"domain": "QBO",
"APAccountRef": {
"name": "Accounts Payable (A/P)",
"value": "33"
},
"CurrencyRef": {
"name": "United States Dollar",
"value": "USD"
},
"TxnDate": "2015-07-28",
"TotalAmt": 25.0,
"ShipAddr": {
"Line4": "Half Moon Bay, CA 94213",
"Line3": "65 Ocean Dr.",
"Id": "121",
"Line1": "Grace Pariente",
"Line2": "Cool Cars"
},
"VendorAddr": {
"Line4": "Middlefield, CA 94303",
"Line3": "42 Main St.",
"Id": "120",
"Line1": "Geoff Hicks",
"Line2": "Hicks Hardware"
},
"POStatus": "Open",
"sparse": false,
"VendorRef": {
"name": "Hicks Hardware",
"value": "41"
},
"Line": [
{
"DetailType": "ItemBasedExpenseLineDetail",
"Amount": 25.0,
"Id": "1",
"ItemBasedExpenseLineDetail": {
"ItemRef": {
"name": "Garden Supplies",
"value": "38"
},
"CustomerRef": {
"name": "Cool Cars",
"value": "3"
},
"Qty": 1,
"TaxCodeRef": {
"value": "NON"
},
"BillableStatus": "NotBillable",
"UnitPrice": 25
}
}
],
"CustomField": [
{
"DefinitionId": "1",
"Type": "StringType",
"Name": "Crew #"
},
{
"DefinitionId": "2",
"Type": "StringType",
"Name": "Sales Rep"
}
],
"Id": "257",
"MetaData": {
"CreateTime": "2015-07-28T16:01:47-07:00",
"LastUpdatedTime": "2015-07-28T16:01:47-07:00"
}
},
"time": "2015-07-28T16:04:49.874-07:00"
}
My website has a guest checkout so I need to know how to generate purchase order for guests as the above json format expects customer id to be sent. Since it is guest who is placing order I do not have customer id to pass for the api