when I call jobs.get(jobId,ProjectID);
I get:
“code” : 400, “errors” : [ {
“domain” : “global”,
“message” : “Invalid project ID ‘My_Project_ID:job_6c2e8cc358ad42d2ad55ef266d342b68’.
Project IDs must contain 6-63 lowercase letters, digits, or dashes. IDs must start with
a letter and may not end with a dash.”,
“reason” : “invalid” } ], “message” : “Invalid project ID ‘My_Project_ID:job_6c2e8cc358ad42d2ad55ef266d342b68’. Project IDs must
contain 6-63 lowercase letters, digits, or dashes. IDs must start with
a letter and may not end with a dash.”
(I switched projectId with “My_Project_ID”)
If I use the exact projectID and jobID in the “try it” section in the google developer guide
in here
I get the job back as expected!
If projectId or jobId wasn’t right then it wouldn’t have worked in the google developer site also.
What can cause this behavior?
It looks like you’re passing the fully-qualified job ID as the project ID. In the example you mentioned above, “My_Project_ID” is the project ID and “job_6c2e8cc358ad42d2ad55ef266d342b68” is the job ID, but it looks like you’re passing the full string “My_Project_ID:job_6c2e8cc358ad42d2ad55ef266d342b68” as the job ID.
Note also that the parameter order is (projectId, jobId), not (jobId, projectId).
Try calling jobs.get(“My_Project_ID”, “job_6c2e8cc358ad42d2ad55ef266d342b68”), and see if that works.