Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagexml
themeRDark
titleXML request example
collapsetrue
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
 <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 	<GetAllocationProfiles xmlns="http://tempuri.org/">
 		<req>
 			<Credentials>
 				<UserName>yourusername</UserName>
 				<Password>yourpassword</Password>
 			</Credentials>
 			<identify>youridentifier</identify>
 			<Args>
 				<BrickId xsi:nil="true" />
 				<Owner xsi:nil="true" />
 				<Key>AllocationProfile1</Key>
 			</Args>
 			<Fields>
 				<BrickId>true</BrickId>
				 <Name>true</Name>
 				<Key>true</Key>
 				<AllocationItems>false</AllocationItems>
 				<Owner>true</Owner>
 			</Fields>
 		</req>
 	</GetAllocationProfiles>
 </s:Body>
</s:Envelope>
Code Block
languagec#
themeRDark
titleC# - CreateAllocationProfiles
linenumberstrue
collapsetrue
//Create an allocation profile with the CreateAllocationProfiles methodvar client = new BFSServiceReference.bfsapiSoapClient();
 
var credentials = new BFSServiceReference.Credentials()
{
    UserName = bfsusername, //Username of administrative user in your instance of BFS
    Password = bfspassword, //Password of the administrative user in your instance of BFS
};
 
var AI1 = new AllocationItem() //The only allocation item
{
    Asset = new Guid("138e92a5-f1d6-4473-9ca4-45f511881676"),
    AllocationPercentage = 1M
};
 
var response = client.CreateAllocationProfiles(new BFSServiceReference.CreateAllocationProfileRequest()
{
    Credentials = credentials,
 
    identify = bfsidentifier, //Identifier is a unique token for your instance of BFS       
 
    Entities = new[]
    {
        new AllocationProfile()
        {     
            Key = "Alloc1",
            Name = "My allocation",
            Owner = new Guid("0a39dc30-9e75-4261-920a-1398fb87c952"),
            AllocationItems = new []
            {
                AI1               
            },           
        },
 
    }
 
});
 
foreach (var c in response.Entities)
{
    Console.WriteLine(c.BrickId + "," + c.Errors);
}

 

Blog Posts
sortcreation
contenttitles
labelscreateallocationprofiles