Developer API

End point

Alle kald sendes til:

https://bestil-nu.net/rest/api

Brugere

Brugere (også kaldet bestillere) er personer, der skal have adgang til at reservere ressourcer og foretage kantinekøb.

Opdater brugere

<script>

$.ajax({
    type: "POST",
    url: "https://bestil-nu.net/rest/api",
    dataType: "json",
    async: "false",
    contentType: "application/json; charset=utf-8",
    headers: {
        "authorization": "Basic OjkyYTEzOWJmODFlZGZhYmI2YzkwMDQ4OGQzZDJmYmRmZDVhOTI1MWNjOTU2NTVmZDRiOGI2OWZhOWIwNzgwNWM=",
    		"accept-version": "v1",
    		"cache-control": "no-cache",
    		"token": "5552e52b-a921-1013-e8c3-e9c865e4df87",
		"command": "UPDATE_USERS"
    },
    data {
       
         "Type":"DELETE",
         "CompanyUid":"5638f4e9-fb5a-4c64-85c5-2adfaaa5dd48",
         "Users":[
          {
         	"InternalId":"PAS2",
         	"Firstname":"Peter",
         	"Lastname":"Andersen",
         	"PhoneLocal":{
            		"Value":"23232323",
            		"Overwrite":"false"
         	},
         	"PhoneMobile":{
            		"Value":"23232323",
            		"Overwrite":"false"
         	},
         	"Email":{
            		"Value":"info@cateringportal.dk",
            		"Overwrite":"false"
         	},
         	"Username":{
            		"Value":"myUserName",
            		"Overwrite":"false"
         	},
         	"UsertypeId": "1",
         	"Active":"true",
         	"Department":{
            		"Reference":"DEPT\\ASI\\PKS",
            		"Name":"Departementet"
         	}
      	},
      	{
         	"InternalId":"PAS2",
         	"Firstname":"Peter",
         	"Lastname":"Andersen",
         	"PhoneLocal":{
            		"Value":"23232323",
            		"Overwrite":"false"
         	},
         	"PhoneMobile":{
            		"Value":"23232323",
            		"Overwrite":"false"
         	},
         	"Email":{
            		"Value":"info@cateringportal.dk",
            		"Overwrite":"false"
         	},
         	"Username":{
            		"Value":"myUserName",
            		"Overwrite":"false"
         	},
         	"UsertypeId": "1",
         	"Active":"true",
         	"Department":{
            		"Reference":"DEPT\\ASI\\PKS",
            		"Name":"Departementet"
         	}
      	}
     
      ]
    },
    success: function(msg) {
        						
          alert( msg );
    },
    error: function (jqXHR, textStatus, errorThrown){
          
          alert('Fejlmeddelelse: '+textStatus );
    }
});

</script>

 

Hent brugere

<script>

$.ajax({
    type: "GET",
    url: https://bestil-nu.net/rest/api",
    dataType: "json",
    async: "false",
    contentType: "application/json; charset=utf-8",
    headers: {
        "authorization": "Basic OjkyYTEzOWJmODFlZGZhYmI2YzkwMDQ4OGQzZDJmYmRmZDVhOTI1MWNjOTU2NTVmZDRiOGI2OWZhOWIwNzgwNWM=",
    		"accept-version": "v1",
    		"cache-control": "no-cache",
    		"token": "5552e52b-a921-1013-e8c3-e9c865e4df87",
    "command": "GET_USERS"
    },
    data {
         "CompanyUid":"5638f4e9-fb5a-4c64-85c5-2adfaaa5dd48",
         "UsertypeIds": "1,2"
    },
    success: function(msg) {
        						
          alert( msg );
    },
    error: function (jqXHR, textStatus, errorThrown){
          
          alert('Fejlmeddelelse: '+textStatus );
    }
});

</script>

 

Afdelinger

Afdelinger (f.eks. Økonomiafdelingen) anvendes til at tildele rettigheder samt til at filtrere bestillinger / køb på i rapporter.

Opdater afdelinger

<script>

$.ajax({
    type: "POST",
    url: "https://bestil-nu.net/rest/api",
    dataType: "json",
    async: "false",
    contentType: "application/json; charset=utf-8",
    headers: {
        "authorization": "Basic OjkyYTEzOWJmODFlZGZhYmI2YzkwMDQ4OGQzZDJmYmRmZDVhOTI1MWNjOTU2NTVmZDRiOGI2OWZhOWIwNzgwNWM=",
    		"accept-version": "v1",
    		"cache-control": "no-cache",
    		"token": "5552e52b-a921-1013-e8c3-e9c865e4df87",
		"command": "UPDATE_DEPARTMENTS"
    },
    data {
       
         "CompanyUid":"5638f4e9-fb5a-4c64-85c5-2adfaaa5dd48",
         "Departments":[
          {
         	"Department":{
            		"Reference":"DEPT\\ASI\\PKS",
            		"Name":"Departementet"
         	}
      	},
      	{
         	"Department":{
            		"Reference":"DEPT\\ASI\\PKS",
            		"Name":"Departementet"
         	}
      	}
     
      ]
    },
    success: function(msg) {
        						
          alert( msg );
    },
    error: function (jqXHR, textStatus, errorThrown){
          
          alert('Fejlmeddelelse: '+textStatus );
    }
});

</script>

 

Hent afdelinger

<script>

$.ajax({
    type: "GET",
    url: https://bestil-nu.net/rest/api",
    dataType: "json",
    async: "false",
    contentType: "application/json; charset=utf-8",
    headers: {
        "authorization": "Basic OjkyYTEzOWJmODFlZGZhYmI2YzkwMDQ4OGQzZDJmYmRmZDVhOTI1MWNjOTU2NTVmZDRiOGI2OWZhOWIwNzgwNWM=",
    		"accept-version": "v1",
    		"cache-control": "no-cache",
    		"token": "5552e52b-a921-1013-e8c3-e9c865e4df87",
    "command": "GET_DEPARTMENTS"
    },
    data {
         "CompanyUid":"5638f4e9-fb5a-4c64-85c5-2adfaaa5dd48"
    },
    success: function(msg) {
        						
          alert( msg );
    },
    error: function (jqXHR, textStatus, errorThrown){
          
          alert('Fejlmeddelelse: '+textStatus );
    }
});

</script>