POST new job
Forum rules
- Check the documentation first. Before posting questions, please check the documentation to ensure it doesn't already cover what you need.
- No spam. All automated messages, advertisements, and links to competitor websites will be deleted immediately.
- Post in relevant sub-forums only. Messages posted in the wrong topic area will be removed and placed in the correct sub-forum by moderators.
- Respect other users. No flaming or abusing fellow forum members. Users who continue to post inflammatory, abusive comments will be deleted from the forum after two warnings are issued by moderators.
- Harassment. No threats or harassment of other users will be tolerated. Any instance of threatening or harassing behavior is grounds for deletion from the forums.
- Adult content. No profanity or pornography is allowed. Posts containing adult material will be deleted.
- Bandwidth. All images and signatures must be 500 x 500 pixels or smaller. Posts containing over-sized images and signatures will be removed.
- Illegal content. No re-posting of copyrighted materials or other illegal content is allowed. Any posts containing illegal content or copyrighted materials will be deleted.
POST new job
Hello,
I have a few questions for when I post a new job;
POST /api/v1.0/companies/{companyID}/jobs/
The api doc states that "technicians" should be an integer, should it be an array of integers?
Also, how do I set a custom field in the same payload?
Last question is, how do I link a cost centre to the associated job? Does that have to be done after a job is created?
I have a few questions for when I post a new job;
POST /api/v1.0/companies/{companyID}/jobs/
The api doc states that "technicians" should be an integer, should it be an array of integers?
Also, how do I set a custom field in the same payload?
Last question is, how do I link a cost centre to the associated job? Does that have to be done after a job is created?
-
BlessingLinys
- Posts: 1
- Joined: Mon Apr 03, 2023 11:01 am
Re: POST new job
The "technicians" field should be an array of integers, even though the API documentation states it as an integer. You can provide an array of technician IDs to this field.
To set a custom field in the same payload, you can include it as a key-value pair in the payload data. For example, if the custom field is named "custom_field", you can include it like this:
{
"title": "Job Title",
"description": "Job Description",
"technicians": [1, 2, 3],
"custom_field": "Custom Field Value"
}
To link a cost centre to the associated job, you can provide the cost centre ID as a field in the payload data. For example:
{
"title": "Job Title",
"description": "Job Description",
"technicians": [1, 2, 3],
"cost_center": 12345
}
This will link the job to the cost centre with ID 12345. This can be done while creating the job itself, and does not need to be done after the job is created.
To set a custom field in the same payload, you can include it as a key-value pair in the payload data. For example, if the custom field is named "custom_field", you can include it like this:
{
"title": "Job Title",
"description": "Job Description",
"technicians": [1, 2, 3],
"custom_field": "Custom Field Value"
}
To link a cost centre to the associated job, you can provide the cost centre ID as a field in the payload data. For example:
{
"title": "Job Title",
"description": "Job Description",
"technicians": [1, 2, 3],
"cost_center": 12345
}
This will link the job to the cost centre with ID 12345. This can be done while creating the job itself, and does not need to be done after the job is created.
Re: POST new job
Thank you. Do you know where the cost centre is in the API? Want to know if its cost_center, cost_centre, costCentre.
With the custom field, is it purely based on the name of the custom field? I can see they have IDs
With the custom field, is it purely based on the name of the custom field? I can see they have IDs
Re: POST new job
Hi Dazwah,
For the setup of the actual cost centers, please see this link:
https://developer.simprogroup.com/apido ... st-Centers
For managaing a cost center on a job please see this link:
https://developer.simprogroup.com/apido ... 0b4eb3c8db
Regards
For the setup of the actual cost centers, please see this link:
https://developer.simprogroup.com/apido ... st-Centers
For managaing a cost center on a job please see this link:
https://developer.simprogroup.com/apido ... 0b4eb3c8db
Regards
Sindre
API Developer | Simpro Software Group
API Developer | Simpro Software Group
Re: POST new job
Hi Sindre,
What I mean is, I cannot find in the "job" (api /api/v1.0/companies/{companyID}/jobs/)
where anything mentions cost_center, just wondering if its hidden elsewhere in the API documentation.
Im also trying to add attachments, can this just be done like the following?
{
"title": "Job Title",
"description": "Job Description",
"technicians": [1, 2, 3],
"cost_center": 12345,
"attachment":{
"file":{
"Filename":"myfilename.doc",
"Base64Data" :"mydata..."
}
}
}
What I mean is, I cannot find in the "job" (api /api/v1.0/companies/{companyID}/jobs/)
where anything mentions cost_center, just wondering if its hidden elsewhere in the API documentation.
Im also trying to add attachments, can this just be done like the following?
{
"title": "Job Title",
"description": "Job Description",
"technicians": [1, 2, 3],
"cost_center": 12345,
"attachment":{
"file":{
"Filename":"myfilename.doc",
"Base64Data" :"mydata..."
}
}
}
Re: POST new job
Hi,
The cost centre info is in a nested structure under jobs, sections and cost centre.
You can use the parameter ?display=all on a job to see more details. ]
Read more on subresources here:
https://developer.simprogroup.com/apido ... place-data
To get an overview of cost centres you can also use this endpoint which has a link to the nested structure:
Regards
The cost centre info is in a nested structure under jobs, sections and cost centre.
You can use the parameter ?display=all on a job to see more details. ]
Code: Select all
api/v1.0/companies/0/jobs/{jobID}?display=allhttps://developer.simprogroup.com/apido ... place-data
To get an overview of cost centres you can also use this endpoint which has a link to the nested structure:
Code: Select all
/api/v1.0/companies/{companyID}/jobCostCenters/Sindre
API Developer | Simpro Software Group
API Developer | Simpro Software Group
Re: POST new job
The attachments will have to be added on the job level and not sections/cost centres.
https://developer.simprogroup.com/apido ... 6ee72946b0
https://developer.simprogroup.com/apido ... 6ee72946b0
Sindre
API Developer | Simpro Software Group
API Developer | Simpro Software Group
Re: POST new job
To set a custom field in the same payload, you can include it as a key-value pair in the payload data. For example, if the custom field is named "custom_field", you can include it like this:
{
"title": "Job Title",
"description": "Job Description",
"technicians": [1, 2, 3],
"custom_field": "Custom Field Value"
}
Can you please verify that this is the correct way to set a custom field in the payload?
{
"title": "Job Title",
"description": "Job Description",
"technicians": [1, 2, 3],
"custom_field": "Custom Field Value"
}
Can you please verify that this is the correct way to set a custom field in the payload?
Re: POST new job
Hi,
Custom fields don't support POST request so I don't think you can add it like described.
You need to know the ID of the custom field you want to patch. So follow this endpoint:
https://developer.simprogroup.com/apido ... f9d625d754
Regards
Custom fields don't support POST request so I don't think you can add it like described.
You need to know the ID of the custom field you want to patch. So follow this endpoint:
https://developer.simprogroup.com/apido ... f9d625d754
Code: Select all
/api/v1.0/companies/{companyID}/jobs/{jobID}/customFields/{customFieldID}Sindre
API Developer | Simpro Software Group
API Developer | Simpro Software Group
DEVELOPER CENTER