Hi…
We have been working with the API,and use it for create projects, and it has been working perfect.
Now we have to create another freeagent account, and we create an app, create contacts by api, and they works perfect.
But now we have been trying to create a project with the api, and it returns
{errors={error={message=Resource not found}}}
error 404 - resource not found
function test(){
var payload2 = { “project”:
{
“name”:“Test Project”,
“contact”:“https://api.freeagent.com/v2/contacts/10352739”,
“budget”:0,
“is_ir35”:false,
“status”:“Active”,
“budget_units”:“Hours”,
“normal_billing_rate”:“0.0”,
“hours_per_day”:“8.0”,
“uses_project_invoice_sequence”:false,
“currency”:“MXN”,
“billing_period”:“hour”,
“include_unbilled_time_in_profitability”:true,
}
}
var url = apiUrl + 'proyects'
var test = FREEAPICDMX.actualTokenCDMX()
var response = UrlFetchApp.fetch(url, {
headers: {
Authorization: 'Bearer ' + FREEAPICDMX.actualTokenCDMX(),
accept: 'application/json'
},
payload: JSON.stringify(payload2),
method: 'POST',
contentType: 'application/json',
muteHttpExceptions : true
});
var resp = JSON.parse(response.getResponseCode());
var resp2 = JSON.parse(response.getContentText());
Logger.log(resp)
Logger.log(resp2)
}
Thanks for your help.