I am following process to create a draft item:
CreateUrl for uploading a text file
Upload txt file on that url
CreateDraftItem and setting the value of content uploadId and upload Url.
publishing the draft item
After following the above process, I am able to create an item successfully but when I am running SearchItems or GetDraftItems to get the item list, content list seems to be empty even I have provided the id and url for the content.
Below is the code I am using to createDraft Item :
private void CreateLayout(int layoutNumber, string uploadUrl, string uploadId)
{
List<Content> con = new List<Content>();
Content tempCon = new Content();
tempCon.Url = uploadUrl;
tempCon.Id = uploadId;
con.Add(tempCon);
PlayFabEconomyAPI.CreateDraftItem(new CreateDraftItemRequest
{
Publish = true,
Item = new PlayFab.EconomyModels.CatalogItem
{
Type = "ugc",
Title = new Dictionary<string, string>
{
{
"neutral","UGCTest"
}
},
Description = new Dictionary<string, string>
{
{
"neutral","A ugc item"
}
},
ContentType = "MapLayout",
IsHidden = false,
Contents = con
}
},
(result) =>
{
Debug.Log(JsonConvert.SerializeObject(result));
Debug.Log(result.Item.CreatorEntity.Id);
},
OnErrorWhileCreatingUGC);
}
Below is the code for getting all the items
PlayFabEconomyAPI.SearchItems(new SearchItemsRequest
{
Entity = new PlayFab.EconomyModels.EntityKey
{
Id = entityKey.Id,
Type = entityKey.Type
},
Count = 10,
Search = "UGCTest"
},
(result) =>
{
Debug.Log(JsonConvert.SerializeObject(result));
},
OnErrorWhileCreatingUGC);