Open-event-server: Implement import jobs api with proper permissions and relationships

Created on 6 Jun 2017  路  8Comments  路  Source: fossasia/open-event-server

High blocker has-PR nextgen rest-api

All 8 comments

@SaptakS @niranjan94 Should the api accept a source url instead of a file, this way all file uploads go through the common file upload api to be implemented in #3738 and we could also accept external urls for external files.
If the above sounds good should a source_url field be added in import_jobs model too ?

@shubham-padia yep. That would be better.

@shubham-padia yes. please add the source_url too in the model. Would be useful for cleanups.

So, flow would be,

  • FE uploads file via upload API
  • FE creates an import_jobs resource with the source url via the usual POST
  • FE gets back a response of the created object
  • FE uses the status relationship to get the import status.

@niranjan94 Yes. What is meant by FE here :sweat_smile: ?

FE => Frontend
BE => Backend

@shubham-padia add the proposed list of endpoints to the issue description

/import_jobs, /users/<int:user_id>/import_jobs,
/import_jobs/<int:id>,
/import_jobs/<int:id>/relationships/user,
/import_jobs/<int:import_job_id>/user,
/users/<int:id>/relationships/import_jobs
Note: source_url and source_type will be added in the schema itself

P.S Also removing from the current milestone as exports and imports should be handled once we are done with all the apis and naming changes, etc is almost done, I hope its okay.

Was this page helpful?
0 / 5 - 0 ratings